mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-23 10:53:34 +03:00
0a827dfb47
no issue
- getter for `error` should return the model, not itself 🤦🏻♂️
22 lines
474 B
JavaScript
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';
|
|
}
|
|
}
|