Adjust how error message is caught and displayed

This commit is contained in:
NI
2019-09-14 21:30:49 +08:00
parent 6b5c444f45
commit d9d0170d1a
8 changed files with 94 additions and 60 deletions

View File

@@ -15,7 +15,7 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
export default class Exception {
export default class Exception extends Error {
/**
* constructor
*
@@ -24,17 +24,8 @@ export default class Exception {
*
*/
constructor(message, temporary) {
this.message = message;
super(message);
this.temporary = temporary;
}
/**
* Return the error string
*
* @returns {string} Error message
*
*/
toString() {
return this.message;
}
}