Skip to content

Commit dac12aa

Browse files
author
Alberto Iannaccone
committed
localize web socket errors
1 parent 900a5f9 commit dac12aa

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

Diff for: arduino-ide-extension/src/browser/monitor-manager-proxy-client-impl.ts

+13-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
Disposable,
44
Emitter,
55
MessageService,
6+
nls,
67
} from '@theia/core';
78
import { inject, injectable } from '@theia/core/shared/inversify';
89
import { Board, Port } from '../common/protocol';
@@ -77,7 +78,12 @@ export class MonitorManagerProxyClientImpl
7778
try {
7879
this.webSocket = new WebSocket(`ws://localhost:${addressPort}`);
7980
} catch {
80-
this.messageService.error('Unable to connect to websocket');
81+
this.messageService.error(
82+
nls.localize(
83+
'arduino/monitor/unableToConnectToWebSocket',
84+
'Unable to connect to websocket'
85+
)
86+
);
8187
return;
8288
}
8389

@@ -106,7 +112,12 @@ export class MonitorManagerProxyClientImpl
106112
this.webSocket?.close();
107113
this.webSocket = undefined;
108114
} catch {
109-
this.messageService.error('Unable to close websocket');
115+
this.messageService.error(
116+
nls.localize(
117+
'arduino/monitor/unableToConnectToWebSocket',
118+
'Unable to close websocket'
119+
)
120+
);
110121
}
111122
}
112123

0 commit comments

Comments
 (0)