mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-12-15 07:52:58 -05:00
Prior to this change, all callers of ViewLoader#load were forced to handle the (checked) IOException declared by the #load method signature. This resulted in a significant amount of duplicate handling logic where nothing more than logging the error occured. Failing to load a view represents a catastrophic error in the application; i.e. it is not something that can be handled in any way other than shutting the application down, fixing what is broken and restarting the application. For this reason, any IOException raised within ViewLoader#load is now caught, wrapped and re-thrown as an (unchecked) RuntimeException. This will be handled by the platform's UncaughtExceptionHandler, and a dialog will be raised to inform the user that a fatal error has occured. As a result all try/catch blocks around calls to ViewLoader#load have now been removed, making for tighter, more readable, and easier to test code. In the future, the distinction between errors that are programmatically recoverable and those that are catastrophic (typically developer errors) will be used to determine whether methods in the Bitsquare API throw checked or unchecked exceptions. |
||
|---|---|---|
| .. | ||
| deploy/package | ||
| main | ||
| test/java | ||