mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-28 21:33:24 +03:00
d51f2bcf23
closes https://github.com/TryGhost/Admin/pull/2107 - updated related babel dependencies - bumped eslint - ran `yarn lint:js --fix` - added eslint ignore comments for some required non-camel-case properties
27 lines
698 B
JavaScript
27 lines
698 B
JavaScript
import Controller from '@ember/controller';
|
|
import classic from 'ember-classic-decorator';
|
|
import {computed} from '@ember/object';
|
|
import {readOnly} from '@ember/object/computed';
|
|
|
|
@classic
|
|
export default class ErrorController extends Controller {
|
|
stack = false;
|
|
|
|
@readOnly('model')
|
|
error;
|
|
|
|
@computed('error.status')
|
|
get code() {
|
|
return this.get('error.status') > 200 ? this.get('error.status') : 500;
|
|
}
|
|
|
|
@computed('error.statusText')
|
|
get message() {
|
|
if (this.code === 404) {
|
|
return 'Page not found';
|
|
}
|
|
|
|
return this.get('error.statusText') !== 'error' ? this.get('error.statusText') : 'Internal Server Error';
|
|
}
|
|
}
|