/** * Get the response status as {@link HttpStatus} * @return the response HttpStatus * @throws InvalidHttpMessageException If the status code of the message does not corresponds to any of the * {@link HttpStatus} values */ default HttpStatus getStatus() { return HttpStatus.of(getStatusCode()) .orElseThrow(() -> new InvalidHttpMessageException("Unknown status code: " + getStatusCode())); }