github.com/hernad/nomad@v1.6.112/ui/app/utils/notify-error.js (about)

     1  /**
     2   * Copyright (c) HashiCorp, Inc.
     3   * SPDX-License-Identifier: MPL-2.0
     4   */
     5  
     6  /* eslint-disable ember/no-controller-access-in-routes */
     7  
     8  // An error handler to provide to a promise catch to set an error
     9  // on the application controller.
    10  export default function notifyError(route) {
    11    return (error) => {
    12      route.controllerFor('application').set('error', error);
    13    };
    14  }