wasmrs-js
Version:
A JavaScript implementation of the RSocket protocol over WebAssembly.
26 lines (22 loc) • 724 B
text/typescript
class TestableError extends Error {
matcher() {
return new RegExp(this.toString().replace(/^Error: /, ''));
}
}
export class HostCallNotImplementedError extends TestableError {
constructor(binding: string, namespace: string, operation: string) {
super(
`Host call not implemented. Guest called host with binding = '${binding}', namespace = '${namespace}', & operation = '${operation}'`
);
}
}
export class InvalidWasm extends TestableError {
constructor(error: Error) {
super(`Invalid wasm binary: ${error.message}`);
}
}
export class StreamingFailure extends TestableError {
constructor(error: Error) {
super(`Could not instantiate from Response object: ${error.message}`);
}
}