| 1 | One or more general exception are needed to organise exception handling in the application. |
| 2 | |
| 3 | |
| 4 | '''Option 1:''' GeoNetworkException extends java.lang.RuntimeException |
| 5 | This is a non checked exception. |
| 6 | |
| 7 | Advantages: |
| 8 | * less boilerplate code |
| 9 | Disadvantages: |
| 10 | * requires well tested code |
| 11 | |
| 12 | '''Option 2:''' GeoNetworkException extends java.lang.Exception |
| 13 | This is a checked exception. Users of api's who can throw this exception need code to catch the exception. |
| 14 | |
| 15 | Advantages: |
| 16 | * it is explicit which exceptions can be thrown |
| 17 | Disadvantages: |
| 18 | * code gets dirty with try catches |
| 19 | |
| 20 | '''Chosen option 1''': |
| 21 | The application is well unit tested. It is important that the code remains clean. |