Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-17631

HTTP error 404 from spring web causes "404 null" message in RestTemplate

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 5.1.3
    • Fix Version/s: Waiting for Triage
    • Component/s: Web
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      I noticed that in RestTemplate-based client, I'm getting error messages like 404 null and similar. Then I found that the Spring Boot application returns error statuses like the following:

      > curl -v http://localhost:8080/page-not-found
      (...)
      < HTTP/1.1 404
      < Content-Type: application/json;charset=UTF-8
      

      which will look like this:

      org.springframework.web.client.HttpClientErrorException$NotFound: 404 null

      Others return results like:

      curl -v http://google.com/page-not-found
      (...)
      < HTTP/1.1 404 Not Found
      < Content-Type: text/html; charset=UTF-8
      

      Which results in a nice looking error message:

      org.springframework.web.client.HttpClientErrorException$NotFound: 404 Not Found

      I'm not sure if I should raise is as a bug - it does not seem that the status message is mandatory.

      Is this a bug, or a feature?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rstoya05-aop Rossen Stoyanchev
                Reporter:
                jerzykrlk Jerzy Krolak
                Last updater:
                Spring Issuemaster
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Days since last comment:
                  47 weeks ago