jersey
  1. jersey
  2. JERSEY-2427

Message "null for uri: http://example.com/favicon.ico" creates an unprofessional image

    Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.17
    • Fix Version/s: 1.20
    • Component/s: core
    • Labels:
      None
    • Environment:

      DropWizard 0.6.2 set up with added RuntimeExceptionMapper.
      Java 1.7
      RedHat Linux.

      Description

      For our API we have a policy of surfacing the result of exception.getMessage() as part of a JSON entity, since these are generally formatted for consumption by a human being. The message for an com.sun.jersey.api.NotFoundException is generated as follows:

      return super.getMessage() + " for uri: " + notFoundUri;

      Which means that the message from the default constructor is prepended to the URL and an English sentence stem. The problem is that in com.sun.jersey.server.impl.application.WebApplicationImpl no such message is supplied. See line 1512 (at at version 1.17.1):

      if (!rootsRule.accept(path, null, localContext))

      { throw new NotFoundException(request.getRequestUri()); }

      The result is a message like: "null for uri: http://example.com/favicon.ico" which could be improved upon greatly simply by adding a message such as:

      if (!rootsRule.accept(path, null, localContext))

      { throw new NotFoundException("No match", request.getRequestUri()); }

      This would result in "No match for uri: http://example.com/favicon.ico".

        Activity

        Hide
        Michal Gajdos added a comment -

        Moving to 1.19.

        Show
        Michal Gajdos added a comment - Moving to 1.19.

          People

          • Assignee:
            Unassigned
            Reporter:
            sjgibbsft
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: