Handle allocation 404s
This commit is contained in:
parent
9d9d66b1a7
commit
ca0b297d47
10
ui/app/mixins/with-model-error-handling.js
Normal file
10
ui/app/mixins/with-model-error-handling.js
Normal file
|
@ -0,0 +1,10 @@
|
|||
import Ember from 'ember';
|
||||
import notifyError from 'nomad-ui/utils/notify-error';
|
||||
|
||||
const { Mixin } = Ember;
|
||||
|
||||
export default Mixin.create({
|
||||
model() {
|
||||
return this._super(...arguments).catch(notifyError(this));
|
||||
},
|
||||
});
|
6
ui/app/routes/allocations/allocation.js
Normal file
6
ui/app/routes/allocations/allocation.js
Normal file
|
@ -0,0 +1,6 @@
|
|||
import Ember from 'ember';
|
||||
import WithModelErrorHandling from 'nomad-ui/mixins/with-model-error-handling';
|
||||
|
||||
const { Route } = Ember;
|
||||
|
||||
export default Route.extend(WithModelErrorHandling);
|
|
@ -1,10 +1,6 @@
|
|||
import Ember from 'ember';
|
||||
import notifyError from 'nomad-ui/utils/notify-error';
|
||||
import WithModelErrorHandling from 'nomad-ui/mixins/with-model-error-handling';
|
||||
|
||||
const { Route } = Ember;
|
||||
|
||||
export default Route.extend({
|
||||
model() {
|
||||
return this._super(...arguments).catch(notifyError(this));
|
||||
},
|
||||
});
|
||||
export default Route.extend(WithModelErrorHandling);
|
||||
|
|
Loading…
Reference in a new issue