Skip to content

Commit

Permalink
Merge pull request #35 from Authress/handle-undefined-window-navigator
Browse files Browse the repository at this point in the history
Exclude navigator which is client side only, when not available.
  • Loading branch information
wparad authored Feb 5, 2024
2 parents 49d50f1 + 35ee013 commit 7f50875
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/httpClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,11 @@ class HttpClient {
}

if (this.logger && this.logger[level]) {
this.logger[level]({ title: message, online: navigator.onLine, method, url, status, data, headers, error, resolvedError });
this.logger[level]({
title: message,
online: typeof navigator === 'undefined' || navigator.onLine,
method, url, status, data, headers, error, resolvedError
});
}

const httpError = {
Expand Down

0 comments on commit 7f50875

Please sign in to comment.