Skip to content

Make it easier to deal with a ServerResponse with a non-standard status code #22872

Closed
@wilkinsona

Description

@wilkinsona

Currently, if a ServerResponse has been built with a status code that is not part of the HttpStatus enum, there's no way to get the response's status. The existing statusCode method will throw an undocumented IllegalArgumentException. It would be useful to have a safe way to get the raw status code or, failing that, to document that an IllegalArgumentException may be thrown if the status is not known to HttpStatus. Another option would be to return null if the int can't be mapped to an HttpStatus but that would require the method to be @Nullable which would be a breaking change.

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions