Handling errors without exceptions