Skip to content

Commit 8b859ce

Browse files
committed
remove the TODO again, can just use the constant
1 parent 1edc212 commit 8b859ce

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

packages/shell-api/src/shell-instance-state.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -435,9 +435,10 @@ export class ShellInstanceState {
435435
(name: string) => !CONTROL_CHAR_REGEXP.test(name)
436436
);
437437
} catch (err: any) {
438-
// TODO: move this code to a method in the shell instance so we don't
439-
// have to hardcode the error code or export it.
440-
if (err?.code === 'SHAPI-10004' || err?.codeName === 'Unauthorized') {
438+
if (
439+
err?.code === ShellApiErrors.NotConnected ||
440+
err?.codeName === 'Unauthorized'
441+
) {
441442
return [];
442443
}
443444
throw err;
@@ -456,9 +457,10 @@ export class ShellInstanceState {
456457
(name: string) => !CONTROL_CHAR_REGEXP.test(name)
457458
);
458459
} catch (err: any) {
459-
// TODO: move this code to a method in the shell instance so we don't
460-
// have to hardcode the error code or export it.
461-
if (err?.code === 'SHAPI-10004' || err?.codeName === 'Unauthorized') {
460+
if (
461+
err?.code === ShellApiErrors.NotConnected ||
462+
err?.codeName === 'Unauthorized'
463+
) {
462464
return [];
463465
}
464466
throw err;

0 commit comments

Comments
 (0)