Skip to content
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
This repository was archived by the owner on Feb 26, 2023. It is now read-only.

Add checked Exceptions on RestClient #508

Description

@rsertelon

Follow up for the discussion on the mailing list

The idea is that it's annoying to remember that RestClient throws Runtime Exceptions when there's either a JSON parsing problem or a problem with the server connection/response.

Activity

  1. pyricau commented on Feb 27, 2013

    @pyricau
    Contributor

    Just to be clear, this would mean:

    • adding compile errors to the annotated @Rest interfaces if they do not declare throwing the right checked exception
    • and therefore breaking backward compatibility on all @Rest interfaces
    • Having to recreate exceptions corresponding to the already existing unchecked ones in the implementation frameworks
    • Having to catch these runtime exceptions in the generated code and throw wrapping checked exceptions instead, leading to and additional layer in the stacktrace.

    Maybe there's a good reason why Spring RestTemplate made these exceptions unchecked :)

  2. rsertelon commented on Feb 28, 2013

    @rsertelon
    ContributorAuthor

    I admit that I didn't look into this thoroughly and it seems to complex for the usefulness of this feature.

    Instead of all these code modifications and the presence of checked exception, it could just be documented then. WDYT?

  3. pyricau commented on Feb 28, 2013

    @pyricau
    Contributor

    Good idea. There's already a slight mention of RestClientException in Rest API, but that's a comment in a code sample.

    Would you mind updating the doc :) ?

  4. rsertelon commented on Mar 1, 2013

    @rsertelon
    ContributorAuthor

    Will do!

  5. DayS commented on Mar 10, 2013

    @DayS
    Contributor

    Any news about it @BluePyth ? :)

  6. rsertelon commented on Mar 10, 2013

    @rsertelon
    ContributorAuthor

    will do tomorrow ;)

  7. rsertelon commented on Mar 11, 2013

    @rsertelon
    ContributorAuthor

    Done, you can have a look at the "Handling error" subsection.

  8. DayS commented on Mar 11, 2013

    @DayS
    Contributor

    Seems correct to me. I'm closing this issue then :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions