mirror of
https://github.com/thinkjs/thinkjs.git
synced 2026-01-25 14:42:47 +00:00
rename displayErrorPage method to displayError
This commit is contained in:
parent
08991c2b9e
commit
98fa0c2e2a
@ -8,7 +8,7 @@ module.exports = think.controller({
|
||||
* @param {Number} status []
|
||||
* @return {Promise} []
|
||||
*/
|
||||
displayErrorPage: function(status){
|
||||
displayError: function(status){
|
||||
|
||||
//hide error message on production env
|
||||
if(think.env === 'production'){
|
||||
@ -41,7 +41,7 @@ module.exports = think.controller({
|
||||
* @return {Promise} []
|
||||
*/
|
||||
_400Action: function(self){
|
||||
return self.displayErrorPage(400);
|
||||
return self.displayError(400);
|
||||
},
|
||||
/**
|
||||
* Forbidden
|
||||
@ -49,7 +49,7 @@ module.exports = think.controller({
|
||||
* @return {Promise} []
|
||||
*/
|
||||
_403Action: function(self){
|
||||
return self.displayErrorPage(403);
|
||||
return self.displayError(403);
|
||||
},
|
||||
/**
|
||||
* Not Found
|
||||
@ -57,7 +57,7 @@ module.exports = think.controller({
|
||||
* @return {Promise} []
|
||||
*/
|
||||
_404Action: function(self){
|
||||
return self.displayErrorPage(404);
|
||||
return self.displayError(404);
|
||||
},
|
||||
/**
|
||||
* Internal Server Error
|
||||
@ -65,7 +65,7 @@ module.exports = think.controller({
|
||||
* @return {Promise} []
|
||||
*/
|
||||
_500Action: function(self){
|
||||
return self.displayErrorPage(500);
|
||||
return self.displayError(500);
|
||||
},
|
||||
/**
|
||||
* Service Unavailable
|
||||
@ -73,6 +73,6 @@ module.exports = think.controller({
|
||||
* @return {Promise} []
|
||||
*/
|
||||
_503Action: function(self){
|
||||
return self.displayErrorPage(503);
|
||||
return self.displayError(503);
|
||||
}
|
||||
});
|
||||
@ -8,8 +8,8 @@ export default class extends think.controller.base {
|
||||
* @param {Number} status []
|
||||
* @return {Promise} []
|
||||
*/
|
||||
displayErrorPage(status){
|
||||
|
||||
displayError(status){
|
||||
|
||||
//hide error message on production env
|
||||
if(think.env === 'production'){
|
||||
this.http.error = null;
|
||||
@ -40,34 +40,34 @@ export default class extends think.controller.base {
|
||||
* @return {Promise} []
|
||||
*/
|
||||
_400Action(){
|
||||
return this.displayErrorPage(400);
|
||||
return this.displayError(400);
|
||||
}
|
||||
/**
|
||||
* Forbidden
|
||||
* @return {Promise} []
|
||||
*/
|
||||
_403Action(){
|
||||
return this.displayErrorPage(403);
|
||||
return this.displayError(403);
|
||||
}
|
||||
/**
|
||||
* Not Found
|
||||
* @return {Promise} []
|
||||
*/
|
||||
_404Action(){
|
||||
return this.displayErrorPage(404);
|
||||
return this.displayError(404);
|
||||
}
|
||||
/**
|
||||
* Internal Server Error
|
||||
* @return {Promise} []
|
||||
*/
|
||||
_500Action(){
|
||||
return this.displayErrorPage(500);
|
||||
return this.displayError(500);
|
||||
}
|
||||
/**
|
||||
* Service Unavailable
|
||||
* @return {Promise} []
|
||||
*/
|
||||
_503Action(){
|
||||
return this.displayErrorPage(503);
|
||||
return this.displayError(503);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user