mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-27 20:03:25 +01:00
Send viewed receipt when you start listening to an audio message
This commit is contained in:
22
ts/jobs/helpers/handleCommonJobRequestError.ts
Normal file
22
ts/jobs/helpers/handleCommonJobRequestError.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
// Copyright 2021 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { LoggerType } from '../../logging/log';
|
||||
import { parseIntWithFallback } from '../../util/parseIntWithFallback';
|
||||
|
||||
export function handleCommonJobRequestError(
|
||||
err: unknown,
|
||||
log: LoggerType
|
||||
): void {
|
||||
if (!(err instanceof Error)) {
|
||||
throw err;
|
||||
}
|
||||
|
||||
const code = parseIntWithFallback(err.code, -1);
|
||||
if (code === 508) {
|
||||
log.info('server responded with 508. Giving up on this job');
|
||||
return;
|
||||
}
|
||||
|
||||
throw err;
|
||||
}
|
||||
Reference in New Issue
Block a user