Displaying only message in the Dialog error (and not the exception name in front of the message)

This commit is contained in:
David Négrier 2021-06-04 16:07:36 +02:00
parent a58d6353cd
commit 01ce94585a

View File

@ -10,7 +10,13 @@ function createErrorStore() {
subscribe,
addErrorMessage: (e: string|Error): void => {
update((messages) => {
messages.push(e.toString());
let message: string;
if (e instanceof Error) {
message = e.message;
} else {
message = e;
}
messages.push(message);
return messages;
});
},