I have implemented a custom action following the example by Jeff Potts.
In this implementation, the action is defined in the share-config-custom.xml file.
This included a success message and a failure message.
<action id="the-action" type="javascript" label="Run the action"
icon="actionIcon">
<param name="function">onActionSimpleRepoAction</param>
<permissions>
<permission allow="true">Write</permission>
</permissions>
<param name="action">the-action</param>
<param name="successMessage">message.action-success</param>
<param name="failureMessage">message.action-failure</param>
</action>
Is it possible to provide different messages depending on the situation?
If the action fails, I would like to be able to display a message that gives the
user a specific reason for the failure, not just "action failed".