Error handling
For proper error handling and reporting, use the following strategy across all plugin methods to throw exceptions:
- Throw
com.fortify.pub.bugtracker.support.BugTrackerExceptionfor any error that the user can act on. Examples are invalid configuration, errors arising from the bug tracking system, bug tracking system failing, and so on. The message with this exception is relayed to the user and is expected to be user friendly. - Throw
com.fortify.pub.bugtracker.support.BugTrackerAuthenticationExceptionif and only if credentials provided to the bug tracking system are incorrect. This exception results in cached bug tracker credentials being cleared. - Throw
RuntimeExceptionor its subclasses for internal exceptions.