瀏覽代碼

HUE-8768 [editor] Initial handling of runtime query errors

e.g.

- query fails when executing and not at submission (UDF...)
- task server won't bubble-up error in execute()
Romain 5 年之前
父節點
當前提交
92a8dbe8df

+ 2 - 2
desktop/core/src/desktop/js/api/apiHelper.js

@@ -1993,9 +1993,9 @@ class ApiHelper {
         if (response && response.query_status) {
           deferred.resolve(response.query_status);
         } else if (response && response.status === -3) {
-          deferred.resolve(EXECUTION_STATUS.expired);
+          deferred.resolve({ status: EXECUTION_STATUS.expired });
         } else {
-          deferred.resolve(EXECUTION_STATUS.failed);
+          deferred.resolve({ status: EXECUTION_STATUS.failed, message: response.message });
         }
       })
       .fail(err => {

+ 5 - 0
desktop/core/src/desktop/js/apps/notebook2/execution/executable.js

@@ -13,6 +13,7 @@
 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 // See the License for the specific language governing permissions and
 // limitations under the License.
+import $ from 'jquery';
 
 import apiHelper from 'api/apiHelper';
 import ExecutionResult from 'apps/notebook2/execution/executionResult';
@@ -302,9 +303,13 @@ export default class Executable {
           case EXECUTION_STATUS.failed:
             this.executeEnded = Date.now();
             this.setStatus(queryStatus.status);
+            if (queryStatus.message) {
+              $.jHueNotify.error(queryStatus.message); // TODO: Inline instead of popup, e.g. ERROR_REGEX in Execute()
+            }
             break;
           default:
             this.executeEnded = Date.now();
+            this.setStatus(EXECUTION_STATUS.failed);
             console.warn('Got unknown status ' + queryStatus.status);
         }
       })