Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-105795

Expose element not found error in GraphQL as 404 instead of 500

    Details

      Description

      As an application developer

      I want the graphQL API to expose elements not found with 404 error code

      so that I can identify easily the error and provide the user with the appropriate info

       

      Acceptance criteria

       

      Given a Liferay portal

      When making a request to query a blog entry with id "3456" (non-existent)

      Then the server will return a message like this:

      {
      "errors": [
      {
      "message": "Exception while fetching data (/blogPosting) : com.liferay.blogs.exception.NoSuchEntryException: No BlogsEntry exists with the primary key 3456",
      "locations": [],
      "errorType": "DataFetchingException",
      "path": null,
      "extensions": {
      "exception":

      { *"errno": 404* }

      ,
      "code": "Not Found"
      }
      }
      ],
      "data":

      { "blogPosting": null }

      }

      with errno set to 404

       

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Packages

                  Version Package
                  7.1.X
                  7.2.X
                  Master