Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/wapython
Path: blob/main/core/kernel/src/wasm/posix/util.ts
1068 views
1
import debug from "debug";
2
const log = debug("posix");
3
4
export class NotImplementedError extends Error {
5
ret: number;
6
constructor(functionName: string, ret?: number) {
7
super(`${functionName} is not implemented yet`);
8
this.name = "NotImplementedError"; // name is a standard exception property.
9
if (ret != null) {
10
this.ret = ret;
11
}
12
}
13
}
14
15
export function notImplemented(functionName: string, ret: number = -1) {
16
console.warn("WARNING: calling NOT IMPLEMENTED function", functionName);
17
log("WARNING: calling NOT IMPLEMENTED function", functionName);
18
throw new NotImplementedError(functionName, ret);
19
}
20
21