Error/exception handling in an OO-ish way