cloud-sdk-js icon indicating copy to clipboard operation
cloud-sdk-js copied to clipboard

Feature Request for Custom Error Codes and Messages

Open golchha007 opened this issue 10 months ago • 1 comments

Describe the Problem

We currently see generic error message is thrown for scenarios as mentioned below. The request is to get custom error message and error code which would help us differentiate between different errors messages and scenarios.

Details :

Certificate format error throw Error(The format of the provided certificate '${certificate.name}' is not supported. Supported formats are: ${supportedCertificateFormats.join(', ')}. ${format && ['jks', 'keystore'].includes(format) ? "You can convert Java Keystores (.jks, .keystore) into PKCS#12 keystores using the JVM's keytool CLI: keytool -importkeystore -srckeystore your-keystore.jks -destkeystore your-keystore.p12 -deststoretype pkcs12" : ''});

Token retrieval error

throw Error([ 'The destination tried to provide authorization tokens but failed in all cases. This is most likely due to misconfiguration.', 'Original error messages:', ...authTokens.map(token => token.error) ].join(util_1.unixEOL));

User token missing error throw Error(No user token (JWT) has been provided. This is strictly necessary for '${destination.authentication}'.);

Propose a Solution

The request is to get custom error message and error code which would help us differentiate between different errors messages and scenarios and will help the consumers of our library to handle different errors more gracefully.

Describe Alternatives

No response

Affected Development Phase

Development

Impact

Inconvenience

Timeline

Users of our library which uses cloud sdk is facing issues and we would need this as soon as possible as it completely blocks our development.

Additional Context

No response

golchha007 avatar Jan 27 '25 08:01 golchha007

Hi @golchha007 ,

Thanks for raising this and providing examples. I have moved this to our backlog. As we're low on capacity, I cannot promise when we'll get to it.

deekshas8 avatar Jan 27 '25 09:01 deekshas8