on_error can lead to deleting object. do not access this after call.