1
0
Fork 0
mirror of https://github.com/TryGhost/Ghost-Admin.git synced 2023-12-14 02:33:04 +01:00
Ghost-Admin/app/controllers/error.js

22 lines
626 B
JavaScript
Raw Normal View History

import Controller from '@ember/controller';
import {computed} from '@ember/object';
import {readOnly} from '@ember/object/computed';
export default Controller.extend({
error: readOnly('model'),
stack: false,
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) {
2015-06-08 12:13:42 +02:00
return 'Page not found';
}
return this.get('error.statusText') !== 'error' ? this.get('error.statusText') : 'Internal Server Error';
})
});