Uploaded image for project: 'Service Packs and Hot Fixes'
  1. Service Packs and Hot Fixes
  2. MNT-7595

Request to improve javascript API root object 'status'.

    Details

    • Type: Service Pack Request
    • Status: Closed (View Workflow)
    • Resolution: Fixed
    • Affects Version/s: 3.2 R
    • Fix Version/s: 3.2.1, 3.3
    • Component/s: Installer
    • Labels:
      None
    • Bug Priority:
      Category 3
    • ACT Numbers:

      16603

      Description

      When using transactional webscripts (defined as <transaction>required</transaction>) we need sometimes (in case of managed critical errors) to cancel/rollback the transaction and return a customized error notification to the client. So far, the only way we have found to indicate the Alfresco/Spring WebScript framework to interrupt and rollback the transaction is to stop the script execution by throwing out an exception. This way, the framework will:

      • cancel/rollback the transaction (no data commited in DB as expected)
        but also:
      • return a typical error 500 (status.code = 500, usual error notification with stack trace...)

      But, we would like to better handle the returned error...
      We wonder if there is another way to notify the framework to cancel/rollback the Spring transaction in order to keep full programmatic control on the returned HTTP answer returned (e.g. return an other error code like 400, return another JSON answer,...).

      Setting status.code = 400 + status.redirect = true is not enough. Without throwing an exception, the framework will consider that the execution went fine and the Repository changes are committed (what we absolutely don't want if we found an error during the execution).

      It would be nice to enhance the javascript API and the javascript root object 'status', so you can write something like following:

      status.code = 400;
      satus.redirect = true;
      status.transactionRollback = true; // TODO add-on

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                closedbugs Closed Bugs
                Reporter:
                rvellozo Ricardo Vellozo
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: