2014-06-24 03:52:10 +04:00
|
|
|
var ErrorController = Ember.Controller.extend({
|
2014-07-30 05:57:19 +04:00
|
|
|
code: Ember.computed('content.status', function () {
|
2014-06-24 03:52:10 +04:00
|
|
|
return this.get('content.status') > 200 ? this.get('content.status') : 500;
|
2014-07-30 05:57:19 +04:00
|
|
|
}),
|
|
|
|
message: Ember.computed('content.statusText', function () {
|
2014-06-24 03:52:10 +04:00
|
|
|
if (this.get('code') === 404) {
|
|
|
|
return 'No Ghost Found';
|
|
|
|
}
|
|
|
|
|
|
|
|
return this.get('content.statusText') !== 'error' ? this.get('content.statusText') : 'Internal Server Error';
|
2014-07-30 05:57:19 +04:00
|
|
|
}),
|
2014-06-24 03:52:10 +04:00
|
|
|
stack: false
|
|
|
|
});
|
|
|
|
|
2014-07-30 05:57:19 +04:00
|
|
|
export default ErrorController;
|