Skip to content

Commit

Permalink
fix: trigger deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
Kpoke committed Nov 3, 2022
1 parent 8b8de13 commit c8af7c5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions server/utils/HttpError.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
/*
* To define a extended error for API, can pass through the error message, http
* code, to bring some convenient for the internal class to throw out the error
* and the outside of the layer can catch the error and convert to a http
* To define a extended error for API, can pass through the error message, http
* code, to bring some convenient for the internal class to throw out the error
* and the outside of the layer can catch the error and convert to a http
* response to client
*/

class HttpError extends Error {
constructor(code, message, toRollback){
constructor(code, message, toRollback) {
super(message);
this.code = code;
// set rollback flag, so the transaction of db would rollback when catch this error
// set default to true
this._toRollback = toRollback || true;
}

shouldRollback(){
shouldRollback() {
return this._toRollback;
}
}
Expand Down

0 comments on commit c8af7c5

Please sign in to comment.