The SDK provides specific error types:Documentation Index
Fetch the complete documentation index at: https://e2b-banner-hover-tooltip.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Maintenance May 12, 8–9 PM PDT (May 13, 03:00–04:00 UTC). ~1 min disruption to sandbox management may occur. Already running sandboxes will not be affected. Questions? Contact us
Maintenance May 12, 8–9 PM PDT (May 13, 03:00–04:00 UTC). ~1 min disruption to sandbox management may occur. Already running sandboxes will not be affected. Questions? Contact us
Handle errors in your template
The SDK provides specific error types:Documentation Index
Fetch the complete documentation index at: https://e2b-banner-hover-tooltip.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
import { AuthError, BuildError, FileUploadError } from 'e2b';
try {
await Template.build(template, 'my-template');
} catch (error) {
if (error instanceof AuthError) {
console.error("Authentication failed:", error.message);
} else if (error instanceof FileUploadError) {
console.error("File upload failed:", error.message);
} else if (error instanceof BuildError) {
console.error("Build failed:", error.message);
}
}
Was this page helpful?