You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are a few places where we catch std::exception and do not end up re-throwing it. This prevents features like stan-dev/stanc3#1393 (an exit() function in the language), and leads to some unexpected behavior.
For example, if an indexing exception occurs during initialization, the program halts. If it occurs during sampling, it's all good. Run this program a few times to get a sense of this:
parameters {
real mu;
}
model {
mu ~normal(0, 1);
if (mu <0) {
array[1] int sigma;
print(sigma[2]);
}
}
When a similar change was made in #2307, the choice was to not catch anything that isn't a std::domain_error. This is what reject() throws in the language, and a lot of our math functions as well, and generally seems like a good choice for "recoverable".
Current Version:
v2.34
The text was updated successfully, but these errors were encountered:
Summary:
There are a few places where we catch
std::exception
and do not end up re-throwing it. This prevents features like stan-dev/stanc3#1393 (anexit()
function in the language), and leads to some unexpected behavior.For example, if an indexing exception occurs during initialization, the program halts. If it occurs during sampling, it's all good. Run this program a few times to get a sense of this:
Description:
I believe I have found the relevant places that need to change and highlighted them here: https://gist.github.com/WardBrian/a21b6e650606e562ca1466eedaa3eb47
When a similar change was made in #2307, the choice was to not catch anything that isn't a
std::domain_error
. This is whatreject()
throws in the language, and a lot of our math functions as well, and generally seems like a good choice for "recoverable".Current Version:
v2.34
The text was updated successfully, but these errors were encountered: