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

Exceptions

jboss-reddeer edited this page Jul 31, 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. For this reasons some approaches were taken to make it simply and expect-able what can happens in different plugins. RedDeer API can throw sever unchecked exceptions based on where 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 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
} 

For Eclipse calling it's similar.

Clone this wiki locally