You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gristlabs_grist-core/app/server/lib/NullSandbox.ts

22 lines
612 B

import {ISandbox} from 'app/server/lib/ISandbox';
export class UnavailableSandboxMethodError extends Error {
constructor(message: string) {
super(message);
}
}
export class NullSandbox implements ISandbox {
public async shutdown(): Promise<unknown> {
throw new UnavailableSandboxMethodError('shutdown is not available');
}
public async pyCall(_funcName: string, ..._varArgs: unknown[]) {
throw new UnavailableSandboxMethodError('pyCall is not available');
}
public async reportMemoryUsage() {
throw new UnavailableSandboxMethodError('reportMemoryUsage is not available');
}
}