BetterDiscordApp-v2/client/src/structs/events/error.js

56 lines
1.1 KiB
JavaScript
Raw Normal View History

2018-02-07 15:41:10 +01:00
/**
* BetterDiscord Error Struct
* Copyright (c) 2015-present Jiiks/JsSucks - https://github.com/Jiiks / https://github.com/JsSucks
* All rights reserved.
* https://betterdiscord.net
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
2018-02-13 23:28:58 +01:00
import Event from './event';
export default class ErrorEvent extends Event {
2018-02-07 15:41:10 +01:00
constructor(args) {
2018-02-13 23:28:58 +01:00
super(args);
2018-02-07 17:02:27 +01:00
this.showStack = false; // For error modal
2018-02-07 15:41:10 +01:00
}
/**
* The module the error occured in.
*/
2018-02-07 15:41:10 +01:00
get module() {
return this.args.module;
}
/**
* A message describing the error.
*/
2018-02-07 15:41:10 +01:00
get message() {
return this.args.message;
}
/**
* The original error object.
*/
2018-02-07 15:41:10 +01:00
get err() {
return this.args.err;
}
/**
* A trace showing which functions were called when the error occured.
*/
2018-02-07 17:02:27 +01:00
get stackTrace() {
return this.err.stack;
}
/**
* The type of event.
*/
2018-02-13 23:28:58 +01:00
get __eventType() {
return 'error';
2018-02-07 17:02:27 +01:00
}
2018-02-07 15:41:10 +01:00
}