Started conversion of inline error handling to Contract based error handling.