mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-12-20 05:57:16 +00:00
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:
@@ -264,6 +264,9 @@ export abstract class CoreServiceContribution extends SketchContribution {
|
||||
let message: undefined | string = undefined;
|
||||
if (CoreError.is(error)) {
|
||||
message = error.message;
|
||||
if (error.code === CoreError.Codes.Verify) {
|
||||
message = message.replace(/[*]/g, '\\*');
|
||||
}
|
||||
} else if (error instanceof Error) {
|
||||
message = error.message;
|
||||
} else if (typeof error === 'string') {
|
||||
|
||||
Reference in New Issue
Block a user