Skip to content

Commit

Permalink
Merge pull request #343 from GSA/parse-browser-error-update
Browse files Browse the repository at this point in the history
Update parseBrowserError function to ensure name and message properti…
  • Loading branch information
akuny authored Jul 17, 2024
2 parents 73febac + 01a7fb3 commit 8a1fa39
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions entities/scan-status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ export enum ScanStatus {

export const parseBrowserError = (err: Error): ScanStatus => {
if (
err.name === 'TimeoutError' ||
err.message.startsWith('net::ERR_CONNECTION_TIMED_OUT') ||
err.message.startsWith('connect ETIMEDOUT')
(err.name && err.name === 'TimeoutError') ||
(err.message &&
(err.message.startsWith('net::ERR_CONNECTION_TIMED_OUT') ||
err.message.startsWith('connect ETIMEDOUT')))
) {
return ScanStatus.Timeout;
}
Expand Down

0 comments on commit 8a1fa39

Please sign in to comment.