Uploaded image for project: 'Confluence Cloud'
  1. Confluence Cloud
  2. CONFCLOUD-74637

AP.confluence.saveMacro does not throw an error even when saving the macro fails

XMLWordPrintable

      Issue Summary

      AP.confluence.saveMacro does not throw an error even when saving the macro fails.

      The suggested way to handle macro saving is by calling saveMacro first and closeMacroEditor afterward. When following this approach, if saveMacro fails, the macro editor will be closed and all changes made by the user will be lost forever.

      Steps to Reproduce

      You can reproduce this behavior by simply blocking the placeholder endpoint:

      1. Open a macro editor, for example, the Aura - Cards
      2. In the chrome network tab, block */wiki/rest/internal/1.0/macro/placeholder
      3. In the javascript console, run:
        try {
            window.AP.confluence.saveMacro({})
        } catch(e)
        {     console.log("This is never printed...", e) }
        

         # Even though the saveMacro function did not successfully save the macro, no error is thrown, indicating that saving was successful.

      Expected Results

      saveMacro has an indication if the call has failed. This could be in the form of a promise or callback as a second parameter, or by simply throwing an error.

      Actual Results

      no error message in try {} catch {} block

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

              Unassigned Unassigned
              61fc5024cfea Mirek Sztuba (Inactive)
              Votes:
              9 Vote for this issue
              Watchers:
              8 Start watching this issue

                Created:
                Updated: