mirror of
https://github.com/pyscript/pyscript.git
synced 2026-03-06 06:38:39 -05:00
synclink integration (#1258)
synclink integration + fixes for `py-repl` related tests and `display` tests
This commit is contained in:
@@ -31,6 +31,11 @@ export enum ErrorCode {
|
||||
export class UserError extends Error {
|
||||
messageType: MessageType;
|
||||
errorCode: ErrorCode;
|
||||
/**
|
||||
* `isinstance` doesn't work correctly across multiple realms.
|
||||
* Hence, `$$isUserError` flag / marker is used to identify a `UserError`.
|
||||
*/
|
||||
$$isUserError: boolean;
|
||||
|
||||
constructor(errorCode: ErrorCode, message: string, t: MessageType = 'text') {
|
||||
super(message);
|
||||
@@ -38,6 +43,7 @@ export class UserError extends Error {
|
||||
this.name = 'UserError';
|
||||
this.messageType = t;
|
||||
this.message = `(${errorCode}): ${message}`;
|
||||
this.$$isUserError = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user