open-nomad/ui/app/mixins/with-model-error-handling.js
2023-04-10 15:36:59 +00:00

15 lines
337 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
import Mixin from '@ember/object/mixin';
import notifyError from 'nomad-ui/utils/notify-error';
// eslint-disable-next-line ember/no-new-mixins
export default Mixin.create({
model() {
return this._super(...arguments).catch(notifyError(this));
},
});