stan
stan copied to clipboard
Print exceptions on one line
Currently, the output looks like
> cat(unique(hmm), sep = "\n")
Informational Message: The current Metropolis proposal is about to be rejected because of the following issue:
Exception thrown at line 306:
stan::math::normal_log: Location parameter[1] is -nan, but must be finite!
If this warning occurs sporadically, such as for highly constrained variable types like covariance matrices, then the sampler is fine,
but if this warning occurs often then your model may be either severely ill-conditioned or misspecified.
This makes it difficult to filter the unique exceptions because the "Exception thrown at line 306" is on a different line than "stan::math::normal_log: Location parameter[1] is -nan, but must be finite!". I'm going to do a one-line PR in a second that puts those two things onto the same line.
#1581 fixed a bit of this. The discussion has some more instances we need to fix.