Escape asterisks in error message content for notification display (#2811)

* Escape asterisks in error message content for notification display

* Add a condition to handle only verification errors

* Match coding style
This commit is contained in:
AK
2025-12-16 14:23:30 -03:00
committed by GitHub
parent 1fa0fd31c8
commit 46f1d7ce0d

View File

@@ -264,6 +264,9 @@ export abstract class CoreServiceContribution extends SketchContribution {
let message: undefined | string = undefined; let message: undefined | string = undefined;
if (CoreError.is(error)) { if (CoreError.is(error)) {
message = error.message; message = error.message;
if (error.code === CoreError.Codes.Verify) {
message = message.replace(/[*]/g, '\\*');
}
} else if (error instanceof Error) { } else if (error instanceof Error) {
message = error.message; message = error.message;
} else if (typeof error === 'string') { } else if (typeof error === 'string') {