Ghost/ghost/admin/app/controllers/error.js

21 lines
541 B
JavaScript
Raw Normal View History

2015-02-13 07:22:32 +03:00
import Ember from 'ember';
const {Controller, computed} = Ember;
export default Controller.extend({
stack: false,
code: computed('content.status', function () {
return this.get('content.status') > 200 ? this.get('content.status') : 500;
}),
message: computed('content.statusText', function () {
if (this.get('code') === 404) {
2015-06-08 13:13:42 +03:00
return 'Page not found';
}
return this.get('content.statusText') !== 'error' ? this.get('content.statusText') : 'Internal Server Error';
})
});