2023-04-10 15:36:59 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
|
|
*/
|
|
|
|
|
2022-01-03 14:43:22 +00:00
|
|
|
import { action } from '@ember/object';
|
|
|
|
import Component from '@glimmer/component';
|
|
|
|
import { tracked } from '@glimmer/tracking';
|
|
|
|
import messageForError from 'nomad-ui/utils/message-from-adapter-error';
|
|
|
|
|
|
|
|
export default class JobPage extends Component {
|
|
|
|
@tracked errorMessage = null;
|
|
|
|
|
|
|
|
@action
|
|
|
|
clearErrorMessage() {
|
|
|
|
this.errorMessage = null;
|
|
|
|
}
|
|
|
|
|
|
|
|
@action
|
|
|
|
handleError(errorObject) {
|
|
|
|
this.errorMessage = errorObject;
|
|
|
|
}
|
|
|
|
|
|
|
|
@action
|
|
|
|
setError(err) {
|
|
|
|
this.errorMessage = {
|
|
|
|
title: 'Could Not Force Launch',
|
|
|
|
description: messageForError(err, 'submit jobs'),
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|