Skip to content

Commit

Permalink
Update rest-client.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Sightler committed Oct 28, 2024
1 parent f0dba40 commit be4ea1a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/ring-client-api/rest-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,20 @@ async function requestWithRetry<T>(
return data
} catch (e: any) {
if (!e.response && !requestOptions.allowNoResponse) {
const message = 'Error: ' + e.message +

Check failure on line 156 in packages/ring-client-api/rest-client.ts

View workflow job for this annotation

GitHub Actions / build (20)

Replace `·'Error:·'·+` with `⏎········'Error:·'·+⏎·······`

Check failure on line 156 in packages/ring-client-api/rest-client.ts

View workflow job for this annotation

GitHub Actions / build (18)

Replace `·'Error:·'·+` with `⏎········'Error:·'·+⏎·······`

Check failure on line 156 in packages/ring-client-api/rest-client.ts

View workflow job for this annotation

GitHub Actions / build (22)

Replace `·'Error:·'·+` with `⏎········'Error:·'·+⏎·······`
(e.cause?.message ? ', Cause: ' + e.cause.message : '') +
(e.cause?.code ? ', Code: ' + e.cause.code : '');

Check failure on line 158 in packages/ring-client-api/rest-client.ts

View workflow job for this annotation

GitHub Actions / build (20)

Extra semicolon

Check failure on line 158 in packages/ring-client-api/rest-client.ts

View workflow job for this annotation

GitHub Actions / build (20)

Delete `;`

Check failure on line 158 in packages/ring-client-api/rest-client.ts

View workflow job for this annotation

GitHub Actions / build (18)

Extra semicolon

Check failure on line 158 in packages/ring-client-api/rest-client.ts

View workflow job for this annotation

GitHub Actions / build (18)

Delete `;`

Check failure on line 158 in packages/ring-client-api/rest-client.ts

View workflow job for this annotation

GitHub Actions / build (22)

Extra semicolon

Check failure on line 158 in packages/ring-client-api/rest-client.ts

View workflow job for this annotation

GitHub Actions / build (22)

Delete `;`
logError(
`Failed to reach Ring server at ${requestOptions.url}. ${e.message}. Trying again in 5 seconds...`,
`Failed to reach Ring server at ${requestOptions.url}. ${message}. Trying again in 5 seconds...`,
)
if (e.message.includes('NGHTTP2_ENHANCE_YOUR_CALM')) {
logError(
`There is a known issue with your current NodeJS version (${process.version}). Please see https://github.com/dgreif/ring/wiki/NGHTTP2_ENHANCE_YOUR_CALM-Error for details`,
)
} else if ((e.message.includes('fetch is not defined'))) {

Check failure on line 166 in packages/ring-client-api/rest-client.ts

View workflow job for this annotation

GitHub Actions / build (20)

Replace `(e.message.includes('fetch·is·not·defined')` with `e.message.includes('fetch·is·not·defined'`

Check failure on line 166 in packages/ring-client-api/rest-client.ts

View workflow job for this annotation

GitHub Actions / build (18)

Replace `(e.message.includes('fetch·is·not·defined')` with `e.message.includes('fetch·is·not·defined'`

Check failure on line 166 in packages/ring-client-api/rest-client.ts

View workflow job for this annotation

GitHub Actions / build (22)

Replace `(e.message.includes('fetch·is·not·defined')` with `e.message.includes('fetch·is·not·defined'`
logError(
`Your current NodeJS version (${process.version}) is too old to support this plugin. Please upgrade to the latest LTS version of NodeJS.`,
)
}
logDebug(e)

Expand Down

0 comments on commit be4ea1a

Please sign in to comment.