From 59e96515476c7850629016a3cc8e2593c7c0711a Mon Sep 17 00:00:00 2001 From: David Luzar Date: Fri, 19 Nov 2021 10:54:23 +0100 Subject: [PATCH] feat: log FS abortError to console (#4279) --- src/actions/actionExport.tsx | 5 +++++ src/components/App.tsx | 2 ++ src/components/ToolButton.tsx | 2 ++ src/utils.ts | 1 + 4 files changed, 10 insertions(+) diff --git a/src/actions/actionExport.tsx b/src/actions/actionExport.tsx index 87cb1d94..16f33f82 100644 --- a/src/actions/actionExport.tsx +++ b/src/actions/actionExport.tsx @@ -154,6 +154,8 @@ export const actionSaveToActiveFile = register({ } catch (error: any) { if (error?.name !== "AbortError") { console.error(error); + } else { + console.warn(error); } return { commitToHistory: false }; } @@ -184,6 +186,8 @@ export const actionSaveFileToDisk = register({ } catch (error: any) { if (error?.name !== "AbortError") { console.error(error); + } else { + console.warn(error); } return { commitToHistory: false }; } @@ -221,6 +225,7 @@ export const actionLoadScene = register({ }; } catch (error: any) { if (error?.name === "AbortError") { + console.warn(error); return false; } return { diff --git a/src/components/App.tsx b/src/components/App.tsx index 4ac5de9d..f017593e 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -4195,6 +4195,8 @@ class App extends React.Component { } catch (error: any) { if (error.name !== "AbortError") { console.error(error); + } else { + console.warn(error); } this.setState( { diff --git a/src/components/ToolButton.tsx b/src/components/ToolButton.tsx index 8cec69f6..6361954f 100644 --- a/src/components/ToolButton.tsx +++ b/src/components/ToolButton.tsx @@ -70,6 +70,8 @@ export const ToolButton = React.forwardRef((props: ToolButtonProps, ref) => { } catch (error: any) { if (!(error instanceof AbortError)) { throw error; + } else { + console.warn(error); } } finally { if (isMountedRef.current) { diff --git a/src/utils.ts b/src/utils.ts index d1057ec8..cb8f72f8 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -303,6 +303,7 @@ export const tupleToCoors = ( /** use as a rejectionHandler to mute filesystem Abort errors */ export const muteFSAbortError = (error?: Error) => { if (error?.name === "AbortError") { + console.warn(error); return; } throw error;