chore: add cause for callback errors (#10823)
This commit is contained in:
parent
d91c3ed675
commit
517c4753f2
@ -160,9 +160,16 @@ export class CallbackRegistry {
|
||||
errorMessage: string | ProtocolError,
|
||||
originalMessage?: string
|
||||
): void {
|
||||
const isError = errorMessage instanceof ProtocolError;
|
||||
const message = isError ? errorMessage.message : errorMessage;
|
||||
const error = isError ? errorMessage : callback.error;
|
||||
let error: ProtocolError;
|
||||
let message: string;
|
||||
if (errorMessage instanceof ProtocolError) {
|
||||
error = errorMessage;
|
||||
error.cause = callback.error;
|
||||
message = errorMessage.message;
|
||||
} else {
|
||||
error = callback.error;
|
||||
message = errorMessage;
|
||||
}
|
||||
|
||||
callback.reject(
|
||||
rewriteError(
|
||||
|
Loading…
Reference in New Issue
Block a user