mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-10 04:46:33 +00:00
Remove gRPC error code from error notifications
This commit is contained in:
parent
f0d9894a16
commit
5ddab1ded7
@ -79,7 +79,13 @@ export class BurnBootloader extends SketchContribution {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.messageService.error(e.toString());
|
let errorMessage = "";
|
||||||
|
if (typeof e === "string") {
|
||||||
|
errorMessage = e;
|
||||||
|
} else {
|
||||||
|
errorMessage = e.toString();
|
||||||
|
}
|
||||||
|
this.messageService.error(errorMessage);
|
||||||
} finally {
|
} finally {
|
||||||
if (this.serialConnection.isSerialOpen()) {
|
if (this.serialConnection.isSerialOpen()) {
|
||||||
await this.serialConnection.connect();
|
await this.serialConnection.connect();
|
||||||
|
@ -277,7 +277,13 @@ export class UploadSketch extends SketchContribution {
|
|||||||
{ timeout: 3000 }
|
{ timeout: 3000 }
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.messageService.error(e.toString());
|
let errorMessage = "";
|
||||||
|
if (typeof e === "string") {
|
||||||
|
errorMessage = e;
|
||||||
|
} else {
|
||||||
|
errorMessage = e.toString();
|
||||||
|
}
|
||||||
|
this.messageService.error(errorMessage);
|
||||||
} finally {
|
} finally {
|
||||||
this.uploadInProgress = false;
|
this.uploadInProgress = false;
|
||||||
this.onDidChangeEmitter.fire();
|
this.onDidChangeEmitter.fire();
|
||||||
|
@ -127,7 +127,13 @@ export class VerifySketch extends SketchContribution {
|
|||||||
{ timeout: 3000 }
|
{ timeout: 3000 }
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.messageService.error(e.toString());
|
let errorMessage = "";
|
||||||
|
if (typeof e === "string") {
|
||||||
|
errorMessage = e;
|
||||||
|
} else {
|
||||||
|
errorMessage = e.toString();
|
||||||
|
}
|
||||||
|
this.messageService.error(errorMessage);
|
||||||
} finally {
|
} finally {
|
||||||
this.verifyInProgress = false;
|
this.verifyInProgress = false;
|
||||||
this.onDidChangeEmitter.fire();
|
this.onDidChangeEmitter.fire();
|
||||||
|
@ -23,6 +23,7 @@ import { NotificationServiceServer } from '../common/protocol';
|
|||||||
import { ArduinoCoreServiceClient } from './cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb';
|
import { ArduinoCoreServiceClient } from './cli-protocol/cc/arduino/cli/commands/v1/commands_grpc_pb';
|
||||||
import { firstToUpperCase, firstToLowerCase } from '../common/utils';
|
import { firstToUpperCase, firstToLowerCase } from '../common/utils';
|
||||||
import { Port } from './cli-protocol/cc/arduino/cli/commands/v1/port_pb';
|
import { Port } from './cli-protocol/cc/arduino/cli/commands/v1/port_pb';
|
||||||
|
import { nls } from '@theia/core';
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
export class CoreServiceImpl extends CoreClientAware implements CoreService {
|
export class CoreServiceImpl extends CoreClientAware implements CoreService {
|
||||||
@ -85,11 +86,16 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService {
|
|||||||
chunk: '\n--------------------------\nCompilation complete.\n',
|
chunk: '\n--------------------------\nCompilation complete.\n',
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
const errorMessage = nls.localize(
|
||||||
|
'arduino/compile/error',
|
||||||
|
'Compilation error: {0}',
|
||||||
|
e.details
|
||||||
|
);
|
||||||
this.responseService.appendToOutput({
|
this.responseService.appendToOutput({
|
||||||
chunk: `Compilation error: ${e.details}\n`,
|
chunk: `${errorMessage}}\n`,
|
||||||
severity: 'error',
|
severity: 'error',
|
||||||
});
|
});
|
||||||
throw e;
|
throw new Error(errorMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -180,11 +186,17 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService {
|
|||||||
' complete.\n',
|
' complete.\n',
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
const errorMessage = nls.localize(
|
||||||
|
'arduino/upload/error',
|
||||||
|
'{0} error: {1}',
|
||||||
|
firstToUpperCase(task),
|
||||||
|
e.details,
|
||||||
|
);
|
||||||
this.responseService.appendToOutput({
|
this.responseService.appendToOutput({
|
||||||
chunk: `${firstToUpperCase(task)} error: ${e.details}\n`,
|
chunk: `${errorMessage}\n`,
|
||||||
severity: 'error',
|
severity: 'error',
|
||||||
});
|
});
|
||||||
throw e;
|
throw new Error(errorMessage);
|
||||||
} finally {
|
} finally {
|
||||||
this.uploading = false;
|
this.uploading = false;
|
||||||
}
|
}
|
||||||
@ -227,11 +239,16 @@ export class CoreServiceImpl extends CoreClientAware implements CoreService {
|
|||||||
result.on('end', () => resolve());
|
result.on('end', () => resolve());
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
const errorMessage = nls.localize(
|
||||||
|
'arduino/burnBootloader/error',
|
||||||
|
'Error while burning the bootloader: {0}',
|
||||||
|
e.details,
|
||||||
|
);
|
||||||
this.responseService.appendToOutput({
|
this.responseService.appendToOutput({
|
||||||
chunk: `Error while burning the bootloader: ${e.details}\n`,
|
chunk: `${errorMessage}\n`,
|
||||||
severity: 'error',
|
severity: 'error',
|
||||||
});
|
});
|
||||||
throw e;
|
throw new Error(errorMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -288,6 +288,15 @@
|
|||||||
"electron": {
|
"electron": {
|
||||||
"couldNotSave": "Could not save the sketch. Please copy your unsaved work into your favorite text editor, and restart the IDE.",
|
"couldNotSave": "Could not save the sketch. Please copy your unsaved work into your favorite text editor, and restart the IDE.",
|
||||||
"unsavedChanges": "Any unsaved changes will not be saved."
|
"unsavedChanges": "Any unsaved changes will not be saved."
|
||||||
|
},
|
||||||
|
"compile": {
|
||||||
|
"error": "Compilation error: {0}"
|
||||||
|
},
|
||||||
|
"upload": {
|
||||||
|
"error": "{0} error: {1}"
|
||||||
|
},
|
||||||
|
"burnBootloader": {
|
||||||
|
"error": "Error while burning the bootloader: {0}"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"theia": {
|
"theia": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user