oracle / oci-typescript-sdk

Oracle Cloud Infrastructure SDK for TypeScript and JavaScript
https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/typescriptsdk.htm
Other
68 stars 50 forks source link

Unable to see error of retrier in OCI SDK #293

Open kunarkkhewal opened 1 month ago

kunarkkhewal commented 1 month ago

In my project, I use OCI object storage, while running on local env. everything is working fine, but on deployment, I am receiving errors like this

Request failed with Exception : [object Object]
Retrying request -> Total Attempts : 1, Retrying after 1.686 seconds...

I am using 'oci-sdk' package for JS/TS After digging into the package underoci-common/lib/retrier.js I found in line 179 console.warn(`Request failed with Exception : ${lastKnownError}\nRetrying request -> Total Attempts : ${waitContext.attemptCount}, Retrying after ${delayTime} seconds...`);

this should be updated to console.warn(`Request failed with Exception : ${JSON.stringify(lastKnownError, null, 2)}\nRetrying request -> Total Attempts : ${waitContext.attemptCount}, Retrying after ${delayTime} seconds...`);

because in string literal if we try to print any object it shows as [object Object]

This can act as a blocker in the development because proper error is not shown.

Thank you

jyotisaini commented 24 minutes ago

Thanks for notifying @kunarkkhewal . We will update the error message to reflect proper error.