Skip to content

Commit 8cc3531

Browse files
Improve HTTP error message formatting
1 parent 939013e commit 8cc3531

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/logger/messages/error.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export const codesError: [number, string][] = [
1414
[c.ERROR_SYNC_OFFLINE_LOADING, c.LOG_PREFIX_SYNC_OFFLINE + 'There was an issue loading the mock feature flags data. No changes will be applied to the current cache. %s'],
1515
[c.ERROR_STREAMING_SSE, c.LOG_PREFIX_SYNC_STREAMING + 'Failed to connect or error on streaming connection, with error message: %s'],
1616
[c.ERROR_STREAMING_AUTH, c.LOG_PREFIX_SYNC_STREAMING + 'Failed to authenticate for streaming. Error: %s.'],
17-
[c.ERROR_HTTP, 'Response status is not OK. Status: %s. URL: %s. Message: %s'],
17+
[c.ERROR_HTTP, 'HTTP request failed with %s. URL: %s. Message: %s'],
1818
// client status
1919
[c.ERROR_CLIENT_LISTENER, 'A listener was added for %s on the SDK, which has already fired and won\'t be emitted again. The callback won\'t be executed.'],
2020
[c.ERROR_CLIENT_DESTROYED, '%s: Client has already been destroyed - no calls possible.'],

src/services/splitHttpClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export function splitHttpClientFactory(settings: ISettings, { getOptions, getFet
7070
}
7171

7272
if (!resp || resp.status !== 403) { // 403's log we'll be handled somewhere else.
73-
log[logErrorsAsInfo ? 'info' : 'error'](ERROR_HTTP, [resp ? resp.status : 'NO_STATUS', url, msg]);
73+
log[logErrorsAsInfo ? 'info' : 'error'](ERROR_HTTP, [resp ? 'status code ' + resp.status : 'no status code', url, msg]);
7474
}
7575

7676
const networkError: NetworkError = new Error(msg);

0 commit comments

Comments
 (0)