Result-based error handling