Adds basic object-based error handling