Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-27152

Show REST exceptions in the Symfony profiler

    Details

      Description

      When an REST exception occurs, it is not shown in the Symfony profiler. It is easily reproduced by requesting a content that doesn't exist, like /api/ezp/v2/content/objects/77777. The profiler for the failing request will have 0 exceptions reported, while one did occur.

      REST exceptions should be listed like any other exception.

        Issue Links

          Activity

          Hide
          Bertrand Dunogier added a comment -

          I don't understand what stacktrace is expected for this particular error. This error says that the FieldTypeHashGenerator can't generate a hash from an object. It is meant to serialize the values returned by the fromHash() method from the FieldType API, that is not supposed to return objects. The Exception described in this issue isn't bubbling up from the FieldType. It is thrown in a switch/case's default statement, so there is no "previous" exception.

          I might be missing something, and maybe it tries to serialize an exception, but I don't really understand how that would happen: if an exception is thrown, it will bubble up until it is caught, and will interrupt this switch case. As mentioned, REST exceptions include the whole exception stack recursively since v1.5.

          Show
          Bertrand Dunogier added a comment - I don't understand what stacktrace is expected for this particular error. This error says that the FieldTypeHashGenerator  can't generate a hash from an object. It is meant to serialize the values returned by the fromHash() method from the FieldType API, that is not supposed to return objects. The Exception described in this issue isn't bubbling up from the FieldType. It is thrown in a switch/case's default statement, so there is no "previous" exception. I might be missing something, and maybe it tries to serialize an exception, but I don't really understand how that would happen: if an exception is thrown , it will bubble up until it is caught, and will interrupt this switch case. As mentioned, REST exceptions include the whole exception stack recursively since v1.5.
          Hide
          Bertrand Dunogier added a comment - - edited

          While there is no earlier exception to show as far as I can tell, the exception is indeed not showing up in the symfony profiler. This should be improved. I'll rephrase the enhancement request (done).

          Show
          Bertrand Dunogier added a comment - - edited While there is no earlier exception to show as far as I can tell, the exception is indeed not showing up in the symfony profiler. This should be improved. I'll rephrase the enhancement request (done).
          Hide
          Bertrand Dunogier added a comment -

          Opened https://github.com/ezsystems/ezpublish-kernel/pull/1968 with a fix that prevents the exceptions from being concealed in the profiler.

          Show
          Bertrand Dunogier added a comment - Opened https://github.com/ezsystems/ezpublish-kernel/pull/1968 with a fix that prevents the exceptions from being concealed in the profiler.

            People

            • Assignee:
              Bertrand Dunogier
              Reporter:
              Nuno Oliveira (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: