فهرست منبع

[editor] Fix issue where duplicate error messages are shown for failed statements in editor v2

Johan Ahlen 5 سال پیش
والد
کامیت
1c5ee053c3

+ 2 - 1
desktop/core/src/desktop/js/apps/notebook2/execution/executable.ts

@@ -224,8 +224,9 @@ export default abstract class Executable {
       } catch (err) {
         if (typeof err === 'string') {
           err = this.adaptError(err);
+          this.logs.errors.push(err);
+          this.logs.notify();
         }
-        this.logs.errors.push(err);
         throw err;
       }
 

+ 1 - 9
desktop/core/src/desktop/js/apps/notebook2/execution/sqlExecutable.ts

@@ -135,15 +135,7 @@ export default class SqlExecutable extends Executable {
         errorCol += this.parsedStatement.location.first_column;
       }
 
-      const adjustedErr = err.replace(
-        match[0],
-        'line ' + errorLine + (errorCol !== null ? ':' + errorCol : '')
-      );
-
-      this.logs.errors.push(adjustedErr);
-      this.logs.notify();
-
-      return adjustedErr;
+      return err.replace(match[0], 'line ' + errorLine + (errorCol !== null ? ':' + errorCol : ''));
     }
     return err;
   }