In order to fix https://github.com/stan-dev/stan/issues/1943, I would like to change the behavior of generated quantities so that rather than crashing when there’s an exception, it catches the exception , writes an error message, and then streams out NaN for all the values after the error.
As is, the crashes in generated quantities do not allow sampling to continue. They should allow sampling to continue as they’re only generated conditional on the samples anyway.
On the down side, once you start generating NaN values under error conditions, how will you ever use those values?
(I wasn’t sure what tag to use for this, so I left it empty.)