Fix error handling in DE (#294)

- Replaced `JSON.stringify(error)` with `error.message`
- Created `ErrorHandlingUtils` and moved all error logging actions in there
This commit is contained in:
victor-meng
2020-10-21 14:28:30 -07:00
committed by GitHub
parent e09730d782
commit 24b5b754ca
46 changed files with 187 additions and 265 deletions

View File

@@ -103,7 +103,7 @@ export default class Database implements ViewModels.Database {
);
NotificationConsoleUtils.logConsoleMessage(
ConsoleDataType.Error,
`Error while fetching database settings for database ${this.id()}: ${JSON.stringify(error)}`
`Error while fetching database settings for database ${this.id()}: ${error.message}`
);
throw error;
}
@@ -239,7 +239,7 @@ export default class Database implements ViewModels.Database {
(error: any) => {
Logger.logError(
JSON.stringify({
error: JSON.stringify(error),
error: error.message,
accountName: this.container && this.container.databaseAccount(),
databaseName: this.id(),
collectionName: this.id()