Exception Handling Patterns

Living with Exceptions

In Java, exceptions occur when some non-planned issue occurs that interrupts the normal flow of execution. Exception handling is accomplished in one of two general ways. The first is to simply allow the exception to propagate up the call stack. This is accomplished by adding the throws  keyword and a list of exception types to the method declaration. The second approach is to execute code that may throw  an exception inside of a try  block. Immediately following the try  block will be one or more catch  blocks that catch the different exception types that may occur in the preceding try block. The catch  block(s) may be followed by a finally  block that is used for cleanup.

Continue reading

Start getting up and running with Upstart

Recently, I needed to write a collection of upstart jobs to start the backend for a project at work. Upstart is a great tool for starting jobs in a particular sequence, but getting everything just right was challenging.

Continue reading

Welcome to Bespoke Bytes

This blog is an experiment in coding and writing. Writing has been a challenge during most of my career, despite writing of one form or another being a major professional activity. Please stay tuned for code examples, opinions, and the occasional rant.

Cheers — Hackworth.

© 2016 Bespoke Bytes

Theme by Anders NorénUp ↑