Skip to content

Commit a6a1156

Browse files
fix: cli info handles not found without showing error message (#1247)
Handles sandbox not found on cli info
1 parent 2f0ff5f commit a6a1156

2 files changed

Lines changed: 11 additions & 1 deletion

File tree

.changeset/icy-eggs-change.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@e2b/cli': minor
3+
---
4+
5+
Handle sandbox not found on cli info

packages/cli/src/commands/sandbox/info.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as commander from 'commander'
2-
import { Sandbox } from 'e2b'
2+
import { NotFoundError, Sandbox } from 'e2b'
33

44
import { ensureAPIKey } from 'src/api'
55
import { asBold } from 'src/utils/format'
@@ -62,6 +62,11 @@ export const infoCommand = new commander.Command('info')
6262
process.exit(1)
6363
}
6464
} catch (err: any) {
65+
if (err instanceof NotFoundError) {
66+
console.error(`Sandbox ${asBold(sandboxID)} wasn't found`)
67+
process.exit(1)
68+
return
69+
}
6570
console.error(err)
6671
process.exit(1)
6772
}

0 commit comments

Comments
 (0)