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

Failure callback not called when JSON WS API returns with exception

    Details

      Description

      Reproduction steps:

      1. Start up the portal
      2. Log in
      3. Open the developer console
      4. Execute the below code:
         Liferay.Service(
          '/organization/get-organization',
          {
            organizationId: 109024114141
          },
          function(obj) {
            console.log(obj);
          },
          function(exception, obj) {
            console.log('error');
            console.log(exception);
            console.log(obj.message);
          }
        );

      Experienced behavior: The callback function is not called

      Expected behavior: Based on what we saw in liferay.js the callback function should be called and the message 'error' should be displayed in the console

      This is from liferay.js, which you can find in the ROOT/html/js/liferay folder

      OPTIONS
      	 *
      	 * Required
      	 * service {string|object}: Either the service name, or an object with the keys as the service to call, and the value as the service configuration object.
      	 *
      	 * Optional
      	 * data {object|node|string}: The data to send to the service. If the object passed is the ID of a form or a form element, the form fields will be serialized and used as the data.
      	 * successCallback {function}: A function to execute when the server returns a response. It receives a JSON object as it's first parameter.
      	 * exceptionCallback {function}: A function to execute when the response from the server contains a service exception. It receives a the exception message as it's first parameter.

       Reproduced on branch commit 23abd79421e309f6bfb59ed4c616a13653ee6507

       Not reproducible on master commit ba9d38fd0c1655c74c8cf11172a278c2b8358ad2

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              linda.sui Linda Sui
              Reporter:
              omar.ezzine Omar Ezzine (Inactive)
              Participants of an Issue:
              Recent user:
              Enterprise Release HU
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                4 years, 19 weeks ago

                  Packages

                  Version Package
                  6.2.X EE