github.com/hernad/nomad@v1.6.112/ui/app/components/job-page.js (about)

     1  /**
     2   * Copyright (c) HashiCorp, Inc.
     3   * SPDX-License-Identifier: MPL-2.0
     4   */
     5  
     6  import { action } from '@ember/object';
     7  import Component from '@glimmer/component';
     8  import { tracked } from '@glimmer/tracking';
     9  import messageForError from 'nomad-ui/utils/message-from-adapter-error';
    10  
    11  export default class JobPage extends Component {
    12    @tracked errorMessage = null;
    13  
    14    @action
    15    clearErrorMessage() {
    16      this.errorMessage = null;
    17    }
    18  
    19    @action
    20    handleError(errorObject) {
    21      this.errorMessage = errorObject;
    22    }
    23  
    24    @action
    25    setError(err) {
    26      this.errorMessage = {
    27        title: 'Could Not Force Launch',
    28        description: messageForError(err, 'submit jobs'),
    29      };
    30    }
    31  }