tfx icon indicating copy to clipboard operation
tfx copied to clipboard

Enhancement: Better API error reporting

Open mponton-cn opened this issue 11 months ago • 1 comments

Hi @straubt1 and tfx.rocks team!

Love the tool! Using it to publish custom providers to the private registry. Thanks for creating it!

This is a request for enhancing error messages with the actual underlying API error information. On my first try to publish a GPG key to TFC I encountered a simple 400 error like this one:

2025/02/04 17:29:13 failed to create gpg key: 400 Bad Request

Now, without going into details and due to another unrelated issue, I ended up in a wild goose chase before I could figure out the underlying issue was:

Image

The content of errors would have been very useful in the error message from tfx ;-)

We reached out to HC about updating the doc for this API endpoint to mention that only RSA/DSA keys are accepted. I had used a latest and greatest ECC format as it's now the default for GPG. Things got back on track after I re-generated the key in RSA format.

mponton-cn avatar Feb 06 '25 14:02 mponton-cn

Hello @mponton-cn! Thank you for the awesome feedback and I agree that there is plenty of improvements on the error handling. One challenge is that the API's do not always give much in terms of response (largely today the errors are just passed as is to the end user). This is a great example of where we could provide better handling.

The good news is that I have been preparing for several enhancements to the overall experience with tfx, this feedback is critical.

If you have any others you are interested in, please do not hesitate to submit a GH issue!

straubt1 avatar Feb 06 '25 14:02 straubt1