From 8c645a4fe74a2446d246abd7d451446df917632b Mon Sep 17 00:00:00 2001 From: Lucas Marshall Date: Tue, 12 Dec 2023 14:19:59 -0800 Subject: [PATCH] fix: return a 401 when tokens can't be refreshed in API (#2056) --- packages/core/errors.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/errors.ts b/packages/core/errors.ts index cba05542a..8d7a8ee27 100644 --- a/packages/core/errors.ts +++ b/packages/core/errors.ts @@ -214,6 +214,6 @@ export class SGTerminalTooManyRequestsError extends SGSyncWorkerError { // Throw this when you want run_object_sync to pause after the current execution export class SGConnectionNoLongerAuthenticatedError extends SGSyncWorkerError { constructor(message: string, status?: number, cause?: Error) { - super(message, status, 'SG_CONNECTION_NO_LONGER_AUTHENTICATED_ERROR', cause); + super(message, status ?? 401, 'SG_CONNECTION_NO_LONGER_AUTHENTICATED_ERROR', cause); } }