export default function errorHandlingHelper(err: any, error: any) { return { // Only use the original error's status code - never fall through to the retry/refresh error's status. // When the refresh attempt fails with 401, that 401 should NOT become the response status // (it would incorrectly trigger forceLogoutHelper even when the original error was a 500). status: err?.status?.status ?? err?.status ?? err?.statusCode ?? 500, message: err?.status?.detail ?? err?.detail ?? err?.message ?? err?.statusMessage ?? error?.detail ?? error?.message ?? error?.statusMessage ?? '' } }