Browse Source

feat: log FS abortError to console (#4279)

David Luzar 3 years ago
parent
commit
59e9651547
4 changed files with 10 additions and 0 deletions
  1. 5 0
      src/actions/actionExport.tsx
  2. 2 0
      src/components/App.tsx
  3. 2 0
      src/components/ToolButton.tsx
  4. 1 0
      src/utils.ts

+ 5 - 0
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 {

+ 2 - 0
src/components/App.tsx

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

+ 2 - 0
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) {

+ 1 - 0
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;