Skip to content

Commit

Permalink
fix: fallback to <environment undetectable> in all environments
Browse files Browse the repository at this point in the history
BREAKING CHANGE: `getUserAgent()` is no longer throwing an error if it cannot determine the user agent, it falls back to `<environment undetectable>` instead
  • Loading branch information
gr2m committed Feb 21, 2020
1 parent d45e9dd commit 8b5a63f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ export function getUserAgent(): string {
try {
return navigator.userAgent;
} catch (e) {
return "<environment unknown>"
return "<environment undetectable>";
}
}
2 changes: 1 addition & 1 deletion src/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ export function getUserAgent(): string {
return "Windows <version undetectable>";
}

throw error;
return "<environment undetectable>";
}
}

0 comments on commit 8b5a63f

Please sign in to comment.