mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-25 04:36:46 +00:00
Capture original error stack when sending messages
This commit is contained in:
@@ -74,6 +74,7 @@ declare global {
|
||||
}
|
||||
interface Error {
|
||||
reason?: any;
|
||||
stackForLog?: string;
|
||||
sender?: SignalProtocolAddressClass;
|
||||
senderUuid?: SignalProtocolAddressClass;
|
||||
}
|
||||
|
||||
@@ -113,7 +113,13 @@ export default class OutgoingMessage {
|
||||
}
|
||||
}
|
||||
|
||||
registerError(identifier: string, reason: string, error?: Error): void {
|
||||
registerError(
|
||||
identifier: string,
|
||||
reason: string,
|
||||
providedError?: Error
|
||||
): void {
|
||||
let error = providedError;
|
||||
|
||||
if (!error || (error.name === 'HTTPError' && error.code !== 404)) {
|
||||
error = new OutgoingMessageError(
|
||||
identifier,
|
||||
@@ -124,6 +130,8 @@ export default class OutgoingMessage {
|
||||
}
|
||||
|
||||
error.reason = reason;
|
||||
error.stackForLog = providedError ? providedError.stack : undefined;
|
||||
|
||||
this.errors[this.errors.length] = error;
|
||||
this.numberCompleted();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user