Open alashworth opened 5 years ago
Comment by syclik
Monday Aug 22, 2016 at 15:14 GMT
I think action is on me to come up with possible exceptions to throw.
Comment by syclik
Tuesday May 09, 2017 at 21:27 GMT
I would suggest using std::system_error
(introduced in C++11).
http://www.cplusplus.com/reference/system_error/system_error/
It takes a string and an error code. With pull request stan-dev/stan#2307, this should pass through and stop the samplers.
Summary:
Add an
exit()
function to the language.We could also call it
error()
,fatal()
, orfatal_error()
.Description:
Currently, we have
reject()
in the Stan language. Usingreject()
rejects the current iteration.We should have matching
exit()
calls in the Stan language. Usingexit()
should stop algorithms from continuing. This will indicate that there is something wrong and shouldn't be ignored. As opposed toreject()
which will continue onto the next iteration.exit()
is usedexit(...)
to the language to match the function signatures ofreject()
.reject()
andexit()
.exit()
call.Reproducible Steps:
Here's an example:
Current Output:
Currently, this will show that the 100 tries for initialization failed.
Expected Output:
Exit the algorithm.
Current Version:
v2.11.0