Skip to content
This repository has been archived by the owner on Dec 5, 2024. It is now read-only.

Exceptions

jpeterka edited this page Oct 22, 2013 · 9 revisions

RedDeer is made of a bunch of plugins and each of them is designed for specific needs. Some plugins are independent and some others are utilizing API from plug-ins bellow. So exception handing is important part what to expect when something goes wrong or if there is some unexpected state. RedDeer API can throw sever unchecked exceptions based on where (in which plugin) this exception was thrown.

You can see these unchecked exception mainly indicating that UI state of operation was not achieved on particular layer.

  • SWTLayerException
  • EclipseException

Reason for this quite obvious. User writing some test and wanting handle unexpected state doesn't need to do comprehensive research what exception might be thrown and also it simplifies process of writing additional API. And by using unchecked exception you have a freedom to ignore errors.

So if you're utilizing SWT layer code and want to handle errors you just need to wrap your call like this

try {
  // SWT layer call
} catch (SWTLayerException e) {
  // desired error handling
} 

If you re-throw an exception don't forget to pass the cause exception.

catch (WaitTimeoutExpiredException cause) {
   throw new SWTLayerException("Something bad happens",cause)
}

For Eclipse layer call EclipseLayerException would be used.

Clone this wiki locally