Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExceptionResult only expects 6 error codes #38

Closed
pcarana opened this issue Jul 4, 2017 · 3 comments
Closed

ExceptionResult only expects 6 error codes #38

pcarana opened this issue Jul 4, 2017 · 3 comments

Comments

@pcarana
Copy link
Contributor

pcarana commented Jul 4, 2017

The object only expects 6 error codes inside its constructor, so what happens when a different code arrives as part of the parameter? For instance, when the server returns a 429 code. In this case there's no title nor description for the error.

Maybe there aren't many error codes currently returned by the server, but the "inconsistency" will grow if someone wishes to add more codes (eg. 301, 302, 303, 40x, etc.) on its own implementation. Probably the best solution will be to place a default case for the switch statement.

Beside this, I would like to suggest another thing. The codes are harcoded, wouldn't be better to declare them as constants or use something that already exists (eg. javax.servlet.http.HttpServletResponse.SC_*)?

@pcarana
Copy link
Contributor Author

pcarana commented Aug 28, 2017

Probably the best solution will be to place a default case for the switch statement.

The default case in the switch statement was added on commit 33d1552, so if there are any other codes to add they can be added at this statement; for now this will return a default message.

Beside this, I would like to suggest another thing. The codes are harcoded, wouldn't be better to declare them as constants or use something that already exists (eg. javax.servlet.http.HttpServletResponse.SC_*)?

Most of the codes expected by the servlet are declared as constants in the mentioned class (javax.servlet.http.HttpServletResponse), but the code 422 isn't, so that's why the codes stayed the same (as Strings).

@pcarana pcarana added this to the v1.1.3 milestone Sep 22, 2017
@pcarana pcarana added the Solved label Sep 22, 2017
@TheRedTrainer
Copy link

Verified. If a non listed error code is returned by a client request, the following structure is displayed in the answer:
{"rdapConformance":["rdap_level_0"],"errorCode":"501","description":"This server does not implement ip requests."}

@pcarana
Copy link
Contributor Author

pcarana commented Nov 9, 2017

Closing, fixed in Red Dog v1.2

@pcarana pcarana closed this as completed Nov 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants