cancel with error code