open-nomad/ui/app/utils/notify-error.js
2023-04-10 15:36:59 +00:00

15 lines
371 B
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
/* eslint-disable ember/no-controller-access-in-routes */
// An error handler to provide to a promise catch to set an error
// on the application controller.
export default function notifyError(route) {
return (error) => {
route.controllerFor('application').set('error', error);
};
}