2015-02-13 07:22:32 +03:00
|
|
|
import Ember from 'ember';
|
2015-08-19 14:55:40 +03:00
|
|
|
|
2015-10-28 14:36:45 +03:00
|
|
|
const {Controller, computed} = Ember;
|
|
|
|
|
|
|
|
export default Controller.extend({
|
|
|
|
|
|
|
|
stack: false,
|
|
|
|
|
|
|
|
code: 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
|
|
|
}),
|
2015-10-28 14:36:45 +03:00
|
|
|
|
|
|
|
message: computed('content.statusText', function () {
|
2014-06-24 03:52:10 +04:00
|
|
|
if (this.get('code') === 404) {
|
2015-06-08 13:13:42 +03:00
|
|
|
return 'Page not found';
|
2014-06-24 03:52:10 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
return this.get('content.statusText') !== 'error' ? this.get('content.statusText') : 'Internal Server Error';
|
2015-10-28 14:36:45 +03:00
|
|
|
})
|
2014-06-24 03:52:10 +04:00
|
|
|
});
|