class DenoSandboxErrorCustom error class for Deno Sandbox operations.
Provides structured error information including:
Symbol for identifying sandbox error instances
Original error that caused this error (for debugging)
Structured error code for programmatic handling
Error name for instanceof checks and logging
Checks if the error is an instance of DenoSandboxError.
try {
await sandbox.execute("some command");
} catch (error) {
if (error instanceof DenoSandboxError) {
switch (error.code) {
case "NOT_INITIALIZED":
await sandbox.initialize();
break;
case "COMMAND_TIMEOUT":
console.error("Command took too long");
break;
default:
throw error;
}
}
}