Ghost/ghost/admin/app/controllers/error.js
Kevin Ansfield 0a827dfb47 Fixed max call stack error on error controller
no issue

- getter for `error` should return the model, not itself 🤦🏻‍♂️
2022-10-07 19:46:30 +01:00

22 lines
474 B
JavaScript

import Controller from '@ember/controller';
export default class ErrorController extends Controller {
stack = false;
get error() {
return this.model;
}
get code() {
return this.error.status > 200 ? this.error.status : 500;
}
get message() {
if (this.code === 404) {
return 'Page not found';
}
return this.error.statusText !== 'error' ? this.error.statusText : 'Internal Server Error';
}
}