diff --git a/src/CameraError.ts b/src/CameraError.ts index a379550..794a1db 100644 --- a/src/CameraError.ts +++ b/src/CameraError.ts @@ -120,8 +120,10 @@ class CameraError 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}`); } /**