mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-08 01:04:39 +08:00
ed749e0f51
- Handles sync errors in a single place. For now, if error is not a socket error, will treat as a permanent error, save the error to the account object, and prevent any other syncing until the error is cleared from the account object - Adds a NylasError class that can be extended and serialized. Adds it to global namespace on all packages and replaces all uses of regular Error
18 lines
377 B
JavaScript
18 lines
377 B
JavaScript
class NylasError extends Error {
|
|
constructor(message) {
|
|
super(message);
|
|
this.name = this.constructor.name;
|
|
this.message = message;
|
|
Error.captureStackTrace(this, this.constructor);
|
|
}
|
|
|
|
toJSON() {
|
|
const obj = {}
|
|
Object.getOwnPropertyNames(this).forEach((key) => {
|
|
obj[key] = this[key];
|
|
});
|
|
return obj
|
|
}
|
|
}
|
|
|
|
module.exports = NylasError
|