Open tpgillam opened 8 months ago
There is no piracy since it's using the error hinting system. But I would like to figure out how to intercept the stack trace.
Thank you for the pointer - I hadn't come across the error hint system before.
It seems the current hinting API design could result in noise / confusion if several packages each registered their own hints for built-in exception types. (My opinion is that, to avoid this, no package should be able to register hints in this way, i.e. similar rules as for type piracy.)
But in any case, this is a comment about the underlying API, not this package- so feel free to close!
I'll keep it open and find out if I can inspect the stacktrace and make it only add if there's a SciML package in the trace.
Open a fresh julia session in a clean (temporary) environment. Then:
Then,
Because
log
is being called outside of the context of any SciML package, I would expect the normal error message to be thrown.One thing that confuses me a bit is that, by behaviour, the
Base.Math.throw_complex_domainerror
function appears to have been piratically redefined:... and yet Julia only claims that one method exists, with the standard implementation:
Even using e.g.
@code_lowered Base.Math.throw_complex_domainerror(:moo, 1)
shows the standard implementation, not what actually gets called.Observed in Julia 1.10, and
SciMLBase
2.21.0.Additional context
This error caused a little confusion for me, as I assumed that it was coming from within a SciML function call -- in fact it was just a call to
log
in some other code I had written. But I happened to have an indirect dependency on SciMLBase, causing the above to occur.