string  results = sql("Jira","SELECT [Name] FROM [V_Institution]);
runnerLog("SQL query completed");
catch string err
runnerLog("SQL query failed : " + err);
runnerLog("SQL query failed.");
The catch all clause will catch the exception when the sql query failed.
How can the script get the query error message to show it immediately to the user ?
Thanks in advance for your help.
Not sure what Jira app you are using to implement this SIL Script. I'm going to assume that you are using Power Scripts | Jira Workflow Automation. If yes, then you can use:
lfShowFieldMessage(field, message, messageClass)
For more information, you may refer to lfShowFieldMessage.
I hope that this helps.
From their documentation; Error handling - it looks like they are trying to keep it as user-friendly as possible by returning empty values rather than throwing exceptions where possible.
From what I can understand, if we use catch-all error, then we might not able to access the error. To confirm this, you might want to contact their support.
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event