mirror of
https://github.com/kemko/nomad.git
synced 2026-01-01 16:05:42 +03:00
Handle allocation 404s
This commit is contained in:
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);
|
||||
|
||||
Reference in New Issue
Block a user