cloudfoundry / cloudfoundry/cf-java-client

Display the code passed to UaaException in UaaException.getMessage()

Open
#973 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement triaged
Dominant language
Java
Stars
334
Forks
319
PR merge metrics
No merged PRs in 30d

Description

Make the logging more informative for the developer. Change simply the code from

    public UaaException(Integer statusCode, String error, String errorDescription) {
        super(statusCode, String.format("%s: %s", error, errorDescription));
        this.error = error;
        ...

to

    public UaaException(Integer statusCode, String error, String errorDescription) {
        super(statusCode, String.format("%s: %s [%s]", error, errorDescription, statusCode));
        this.error = error;
        ...

This will avoid painful debugging and work around.

Do the same for the other concrete classes extending AbstractCloudFoundryException aka ClientV2Exception (seems good), Clientv3Exception (seems good), UnknownCloudFoundryException (to fix)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the UaaException constructor shown in the issue, then inspect the other concrete subclasses of AbstractCloudFoundryException, including ClientV2Exception, Clientv3Exception, and UnknownCloudFoundryException. Confirm the exception messages expose the status code consistently, with the already-correct classes serving as references, and verify the resulting behavior with the project's existing tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.