open-nomad/ui/app/components/job-page.js
2022-01-24 11:02:04 -05:00

27 lines
597 B
JavaScript

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'),
};
}
}