2017-08-22 10:53:26 +03:00
|
|
|
import Controller from '@ember/controller';
|
2015-10-28 14:36:45 +03:00
|
|
|
|
2022-02-01 12:34:03 +03:00
|
|
|
export default class ErrorController extends Controller {
|
|
|
|
stack = false;
|
2015-10-28 14:36:45 +03:00
|
|
|
|
2022-10-07 20:05:24 +03:00
|
|
|
get error() {
|
2022-10-07 21:46:30 +03:00
|
|
|
return this.model;
|
2022-10-07 20:05:24 +03:00
|
|
|
}
|
2015-10-28 14:36:45 +03:00
|
|
|
|
2022-02-01 12:34:03 +03:00
|
|
|
get code() {
|
2022-10-07 20:05:24 +03:00
|
|
|
return this.error.status > 200 ? this.error.status : 500;
|
2022-02-01 12:34:03 +03:00
|
|
|
}
|
2015-10-28 14:36:45 +03:00
|
|
|
|
2022-02-01 12:34:03 +03:00
|
|
|
get message() {
|
2019-03-06 16:53:54 +03:00
|
|
|
if (this.code === 404) {
|
2015-06-08 13:13:42 +03:00
|
|
|
return 'Page not found';
|
2014-06-24 03:52:10 +04:00
|
|
|
}
|
|
|
|
|
2022-10-07 20:05:24 +03:00
|
|
|
return this.error.statusText !== 'error' ? this.error.statusText : 'Internal Server Error';
|
2022-02-01 12:34:03 +03:00
|
|
|
}
|
|
|
|
}
|