mirror of
https://github.com/valitydev/redash.git
synced 2024-11-06 17:15:17 +00:00
Fix to error handling: CR2
This commit is contained in:
parent
effb212e4b
commit
aa970a0afb
@ -14,7 +14,7 @@ export default function init(ngModule) {
|
||||
|
||||
ngModule.component('appView', {
|
||||
template,
|
||||
controller($rootScope, $scope, $route, $timeout, Auth) {
|
||||
controller($rootScope, $scope, $route, Auth) {
|
||||
this.showHeaderAndFooter = false;
|
||||
|
||||
this.error = null;
|
||||
@ -54,16 +54,6 @@ export default function init(ngModule) {
|
||||
}
|
||||
});
|
||||
|
||||
$rootScope.$on('$routeChangeSuccess', () => {
|
||||
// Show any error if it occurred during route changing
|
||||
this.error = handler.error instanceof Error ? handler.error : null;
|
||||
// Wait for error for some grace period - to catch errors during
|
||||
// controller instantiation, in example
|
||||
$timeout(() => {
|
||||
this.error = handler.error instanceof Error ? handler.error : null;
|
||||
}, 50);
|
||||
});
|
||||
|
||||
$rootScope.$on('$routeChangeError', (event, current, previous, rejection) => {
|
||||
throw new PromiseRejectionError(rejection);
|
||||
});
|
||||
|
@ -5,7 +5,7 @@
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"start": "webpack-dev-server",
|
||||
"start-demo": "REDASH_BACKEND=https://dev.redashapp.com npm start",
|
||||
"dev": "REDASH_BACKEND=https://dev.redashapp.com npm start",
|
||||
"build": "rm -rf ./client/dist/ && NODE_ENV=production node node_modules/.bin/webpack",
|
||||
"watch": "webpack --watch --progress --colors -d"
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user