Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,553,276
Community Members
 
Community Events
184
Community Groups

Try/catch behavior in batch.js

Edited

I'm writing a P2 plugin for Confluence. This code transforms a .js file on the fly using the Web Resource Transformer. Everything works absolutely perfectly in a barely-configured developer plugin instance (created from running `atlas-debug`), but when I connect to a real staging server (highly configured & customized with many plugins). Version numbers don't seem to be an issue, since if I match the staging servers' version numbers, I observe the same result. But in any case, I've tried with both 7.19.8 and 7.13.7.

On the development environments, I see something like this:

/* module-key = 'confluence.extra.jira:web-resources', location = 'templates/extra/jira/jiraIssues.js' */


{code...}

;

On the two staging servers, I observed identical behavior:

try{ 
/* module-key = 'confluence.extra.jira:web-resources', location = 'templates/extra/jira/jiraIssues.js' */


{code...}

}catch(e){WRMCB(e)};
;

This try/catch code block is repeated for each of the scripts that are being compiled (100s of times). The issue I see is that on the staging servers, `}catch(e){WRMCB(e)}` to close out the try/catch block never comes, so it fails. I want to find out what is generating these try/catch code blocks to see if I can find some reference or perhaps even support, but my searches so far are coming up empty. 

Here is the relevant portion of the atlassian-plugin.xml 



<web-resource key="js-transform-javascript">
<dependency>com.atlassian.auiplugin:ajs</dependency>
<transformation extension="js">
<transformer key="js-transformation" />
</transformation>
<resource type="download" name="/js/js-mod.js" location="/js/js-mod.js" />
<context>atl.general</context>
</web-resource>
<web-resource-transformer key="js-transformation" class="com.example.app.jsTransformer" />

Two final notes: when I examine the failing code, I can observe that the correct transformation has taken place. And when I manually append the closing code fragment, the javascript loads without errors:

}catch(e){WRMCB(e)};
;

 

1 answer

1 accepted

It turns out that the "WRMCB" refers to the Web Resource Manager Catch Block. It's part of production environments, but for obvious reasons, it's disabled by default in Dev Environments. If you need to enable this to debug the functionality (or your plugin in a test environment) you can do so using the following command:

atlas-debug -Dplugin.webresource.javascript.try.catch.wrapping=true

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
7.19.8
TAGS
AUG Leaders

Atlassian Community Events