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

JSON serialized exceptions are meaningless and require heuristics

    Details

      Description

      When a service call throws the exception will be serialized as

      {
        "exception": "No such BlogsEntry for key { entryId = 1234 }"
      }
      

      which is very helpful if you’re a developer trying to debug the problem, but not so much if you have to progammatically act on exceptions.

      Currently in liferay-connector we’re forced to heuristics to target at least the category of the problem (see https://github.com/smclab/liferay-connector/blob/4ad57b6e27d29f99f25296c8a5c8b0646763c36e/lib/invoker.js#L64)

      A better serialization could be IMHO

      {
        "message": "No such BlogsEntry for key { entryId = 1234 }",
        "exception": "com.liferay.portlet.blogs.service.NoSuchBlogsEntryException"
      }
      

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Days since last comment:
                  4 years, 33 weeks, 2 days ago

                  Packages

                  Version Package
                  6.2.3 CE GA4
                  6.2.X EE
                  7.0.0 M3