diff --git a/packages/ring-client-api/rest-client.ts b/packages/ring-client-api/rest-client.ts index 797301a3..e646d38b 100644 --- a/packages/ring-client-api/rest-client.ts +++ b/packages/ring-client-api/rest-client.ts @@ -153,13 +153,20 @@ async function requestWithRetry( return data } catch (e: any) { if (!e.response && !requestOptions.allowNoResponse) { + const message = 'Error: ' + e.message + + (e.cause?.message ? ', Cause: ' + e.cause.message : '') + + (e.cause?.code ? ', Code: ' + e.cause.code : ''); 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'))) { + 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)