How to skip an error message

Hi all!

I am trying to compute the posterior mode in a bayesian estimation starting from different initial parameter values (randomly sampled from a uniform distribution) just to make sure I obtain the highest mode. For some initial values, I get the error message “Initial parameter values are outside parameter bounds”. Does anybody know how could I tell Dynare to skip this set of initial values and continue to the next set? Thanks!

Use the Matlab try-catch construct.