Please see [Loop over parameters). If you call
info = stoch_simul(var_list_);
the value in info is the error code.
info