Closed
Description
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.