Error handling for AP.confluence.saveMacro? All changes are lost if something goes wrong

I’ve found that AP.confluence.saveMacro occasionally fails, without throwing any error. You can force this behavior by simply blocking the request to the placeholder endpoint. saveMacro will fail, but it won’t throw any error. When closing the macro editor afterwards, all changes made will be lost.

Is there any known workaround in case anything goes wrong during the saveMacro call? The function does not throw an error so I could not find any obvious answer.