fix: better WS error map

This commit is contained in:
Adhiraj Singh
2022-06-20 15:18:04 +05:30
parent cacc1ce130
commit 6c4f63237f

View File

@@ -339,6 +339,8 @@ export const getCodeFromWSError = (error: Error) => {
if(!Number.isNaN(code) && code >= 400) {
statusCode = code
}
} else if((error as any).code?.startsWith('E')) { // handle ETIMEOUT, ENOTFOUND etc
statusCode = 408
}
return statusCode