mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 22:02:11 +03:00
48e3bf003d
no issue - https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/order-in-components.md - https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/order-in-controllers.md - https://github.com/ember-cli/eslint-plugin-ember/blob/master/docs/rules/order-in-routes.md
22 lines
626 B
JavaScript
22 lines
626 B
JavaScript
import Controller from '@ember/controller';
|
|
import {computed} from '@ember/object';
|
|
import {readOnly} from '@ember/object/computed';
|
|
|
|
export default Controller.extend({
|
|
|
|
stack: false,
|
|
error: readOnly('model'),
|
|
|
|
code: computed('error.status', function () {
|
|
return this.get('error.status') > 200 ? this.get('error.status') : 500;
|
|
}),
|
|
|
|
message: computed('error.statusText', function () {
|
|
if (this.get('code') === 404) {
|
|
return 'Page not found';
|
|
}
|
|
|
|
return this.get('error.statusText') !== 'error' ? this.get('error.statusText') : 'Internal Server Error';
|
|
})
|
|
});
|