Class: SandboxViolationError
Defined in: src/types/errors.ts:561
Sandbox security violation error.
Remarks
Thrown when a plugin violates security constraints enforced by the isolated-vm sandbox. This includes network access violations, storage quota exceeded, CPU timeout, memory limit exceeded, or unauthorized hook access.
Example
throw new SandboxViolationError(
'com.example.plugin',
'MEMORY',
'Plugin exceeded 128MB memory limit'
);
Extends
Constructors
new SandboxViolationError()
new SandboxViolationError(
pluginId,violationType,message):SandboxViolationError
Defined in: src/types/errors.ts:581
Creates a new SandboxViolationError.
Parameters
pluginId
string
ID of the plugin that violated sandbox rules
violationType
Type of violation ('NETWORK', 'STORAGE', 'CPU', 'MEMORY', 'HOOK')
message
string
Description of the violation
Returns
Overrides
Properties
cause?
readonlyoptionalcause:Error
Defined in: src/types/errors.ts:71
Original error that caused this error (if any).
Remarks
Error chaining allows tracking the full error context through multiple layers of the application. Useful for debugging complex error scenarios.
Example
try {
await fetchData();
} catch (err) {
throw new ValidationError('Failed to validate data', 'field', 'required', err as Error);
}
Inherited from
code
readonlycode:"SANDBOX_VIOLATION"='SANDBOX_VIOLATION'
Defined in: src/types/errors.ts:562
Machine-readable error code.
Remarks
Error codes are unique identifiers for error types, enabling programmatic error handling (switch statements, error maps), error tracking in monitoring systems, and client-side error translation (i18n).
Overrides
pluginId
readonlypluginId:string
Defined in: src/types/errors.ts:567
ID of the plugin that violated sandbox rules.
violationType
readonlyviolationType:SandboxViolationType
Defined in: src/types/errors.ts:572
Type of sandbox violation.