2023-04-10 15:36:59 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
|
|
*/
|
|
|
|
|
2021-12-28 15:31:49 +00:00
|
|
|
/* eslint-disable ember/no-controller-access-in-routes */
|
|
|
|
|
2017-09-28 17:06:13 +00:00
|
|
|
// An error handler to provide to a promise catch to set an error
|
|
|
|
// on the application controller.
|
|
|
|
export default function notifyError(route) {
|
2021-12-28 14:45:20 +00:00
|
|
|
return (error) => {
|
2017-09-28 17:06:13 +00:00
|
|
|
route.controllerFor('application').set('error', error);
|
|
|
|
};
|
|
|
|
}
|