Displaying only message in the Dialog error (and not the exception name in front of the message)
This commit is contained in:
parent
a58d6353cd
commit
01ce94585a
@ -10,7 +10,13 @@ function createErrorStore() {
|
|||||||
subscribe,
|
subscribe,
|
||||||
addErrorMessage: (e: string|Error): void => {
|
addErrorMessage: (e: string|Error): void => {
|
||||||
update((messages) => {
|
update((messages) => {
|
||||||
messages.push(e.toString());
|
let message: string;
|
||||||
|
if (e instanceof Error) {
|
||||||
|
message = e.message;
|
||||||
|
} else {
|
||||||
|
message = e;
|
||||||
|
}
|
||||||
|
messages.push(message);
|
||||||
return messages;
|
return messages;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user