Override CameraError toString
This commit is contained in:
parent
7c33839e36
commit
e02c051e19
@ -116,11 +116,17 @@ class CameraError<TCode extends CameraErrorCode> extends Error {
|
|||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
constructor(code: TCode, message: string, cause?: ErrorWithCause) {
|
constructor(code: TCode, message: string, cause?: ErrorWithCause) {
|
||||||
super(`[${code}]: ${message}${cause ? ` (Cause: ${cause.message})` : ''}`);
|
super(`[${code}]: ${message}${cause != null ? ` (Cause: ${cause.message})` : ''}`);
|
||||||
|
super.name = code;
|
||||||
|
super.message = message;
|
||||||
this._code = code;
|
this._code = code;
|
||||||
this._message = message;
|
this._message = message;
|
||||||
this._cause = cause;
|
this._cause = cause;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public toString(): string {
|
||||||
|
return `[${this.code}]: ${this.message}`;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user