public class ApplicationMain public static void main( String[ args)( tr ●●●●●●●●● ApplicationMain m= new Application Maino m initialize m execute m terminate catch(AppDomainException de)i l Domain exceptions shouldn't get to this level as / they should be handled in the user interface. If l they get here, report the text to the user and /log them in a local log file catch(App TechnicalEXception te) l Technical exceptions here are probably user interface l problems. Display a generic apology and log to a ∥/ ocal log file catch (Throwable tt /Other exception objects must be internal errors e●●● /I that could not be caught and handled elsewhere u Display a generic anology and log to a local logfile
public class ApplicationMain { ... public static void main(String[] args) { try{ ApplicationMain m = new ApplicationMain() ; m.initialize() ; m.execute() ; m.terminate() ; } catch(AppDomainException de) { // Domain exceptions shouldn’t get to this level as // they should be handled in the user interface. If // they get here, report the text to the user and // log them in a local log file } catch(AppTechnicalException te) { // Technical exceptions here are probably user interface // problems. Display a generic apology and log to a // local log file } catch(Throwable t) { // Other exception objects must be internal errors // that could not be caught and handled elsewhere. // Display a generic apology and log to a local log file } } }
Error Handling Strategies Expected unexpected Domain Handle in the application Throw an exception C Display details to the use Display details to the user g the error Dont log the error Technical|. Handle in the application Throw an exception Don' t display details to the Don' t display details to the user usel Log the Don t log the error
Error Handling Strategies