Initial attempt at exception handling