fix: Fix cause

This commit is contained in:
Marc Rousavy 2022-03-22 11:15:27 +01:00
parent cae1efe87d
commit cc09280c19

View File

@ -120,8 +120,10 @@ class CameraError<TCode extends CameraErrorCode> extends Error {
public get message(): string {
return this._message;
}
public get cause(): ErrorWithCause | undefined {
return this._cause;
public get cause(): Error | undefined {
const c = this._cause;
if (c == null) return undefined;
return new Error(`[${c.code}]: ${c.message}`);
}
/**