You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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_*)?
The text was updated successfully, but these errors were encountered:
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).
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."}
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_*)?
The text was updated successfully, but these errors were encountered: