Raise an error in check_cancel_move function

issue3196
review842002