Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

fix: cli info handles not found without showing error message (#1247)

Matt Brockmana6a1156a7675
diff --git a/.changeset/icy-eggs-change.md b/.changeset/icy-eggs-change.md
new file mode 100644
index 000000000..d6072b3f1
--- /dev/null
+++ b/.changeset/icy-eggs-change.md
@@ -0,0 +1,5 @@
+---
+'@e2b/cli': minor
+---
+
+Handle sandbox not found on cli info
diff --git a/packages/cli/src/commands/sandbox/info.ts b/packages/cli/src/commands/sandbox/info.ts
index 85395a3b0..185d650b0 100644
--- a/packages/cli/src/commands/sandbox/info.ts
+++ b/packages/cli/src/commands/sandbox/info.ts
@@ -1,5 +1,5 @@
import * as commander from 'commander'
-import { Sandbox } from 'e2b'
+import { NotFoundError, Sandbox } from 'e2b'
import { ensureAPIKey } from 'src/api'
import { asBold } from 'src/utils/format'
@@ -62,6 +62,11 @@ export const infoCommand = new commander.Command('info')
process.exit(1)
}
} catch (err: any) {
+ if (err instanceof NotFoundError) {
+ console.error(`Sandbox ${asBold(sandboxID)} wasn't found`)
+ process.exit(1)
+ return
+ }
console.error(err)
process.exit(1)
}