feat: log FS abortError to console (#4279)

This commit is contained in:
David Luzar 2021-11-19 10:54:23 +01:00 committed by GitHub
parent 1c48d122e0
commit 59e9651547
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 0 deletions

View File

@ -154,6 +154,8 @@ export const actionSaveToActiveFile = register({
} catch (error: any) { } catch (error: any) {
if (error?.name !== "AbortError") { if (error?.name !== "AbortError") {
console.error(error); console.error(error);
} else {
console.warn(error);
} }
return { commitToHistory: false }; return { commitToHistory: false };
} }
@ -184,6 +186,8 @@ export const actionSaveFileToDisk = register({
} catch (error: any) { } catch (error: any) {
if (error?.name !== "AbortError") { if (error?.name !== "AbortError") {
console.error(error); console.error(error);
} else {
console.warn(error);
} }
return { commitToHistory: false }; return { commitToHistory: false };
} }
@ -221,6 +225,7 @@ export const actionLoadScene = register({
}; };
} catch (error: any) { } catch (error: any) {
if (error?.name === "AbortError") { if (error?.name === "AbortError") {
console.warn(error);
return false; return false;
} }
return { return {

View File

@ -4195,6 +4195,8 @@ class App extends React.Component<AppProps, AppState> {
} catch (error: any) { } catch (error: any) {
if (error.name !== "AbortError") { if (error.name !== "AbortError") {
console.error(error); console.error(error);
} else {
console.warn(error);
} }
this.setState( this.setState(
{ {

View File

@ -70,6 +70,8 @@ export const ToolButton = React.forwardRef((props: ToolButtonProps, ref) => {
} catch (error: any) { } catch (error: any) {
if (!(error instanceof AbortError)) { if (!(error instanceof AbortError)) {
throw error; throw error;
} else {
console.warn(error);
} }
} finally { } finally {
if (isMountedRef.current) { if (isMountedRef.current) {

View File

@ -303,6 +303,7 @@ export const tupleToCoors = (
/** use as a rejectionHandler to mute filesystem Abort errors */ /** use as a rejectionHandler to mute filesystem Abort errors */
export const muteFSAbortError = (error?: Error) => { export const muteFSAbortError = (error?: Error) => {
if (error?.name === "AbortError") { if (error?.name === "AbortError") {
console.warn(error);
return; return;
} }
throw error; throw error;