-
Notifications
You must be signed in to change notification settings - Fork 449
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tracing reports a swallowed CancellationException warning #3388
Comments
Hey @CLOVIS-AI, That is just the standard message of the
I am open to improving or updating it though, since you felt it was confusing here. What I find confusing is that: public fun suppressedExceptions(): List<Throwable> =
exception.cause?.suppressedExceptions.orEmpty() + exception.suppressedExceptions Seems to include a reference to itself. Since what you're seeing here is the With kind-of, I mean that you change the type of the exception and this thus by-passes the So I think the bug here is that |
To clarify, if this were to be done, would the initial cause still be available as part of the trace? If so, that sounds like the way to go. |
Yes, but I think I might have spotted an edge case so let's discuss here and I'm going to involve @kyay10 since he worked on this last. So currently we have the following behavior: trace({
raise("Boom") // this results in RaiseCanecllationException
1
}) { trace, error -> trace.printStackTrace() } // <-- this shows RaiseCancellationException
// <-- RaiseCanecllationException is rethrown What needs to happen here: data class OtherError(val msg: String)
either<OtherError, Int> {
trace({
raise("Boom") // this results in RaiseCanecllationException
1
}) { trace, error ->
raise(OtherError(error)) // <-- original RaiseCancellationException String disappears,
// and a new appears one for OtherError is thrown
} I don't think this is problematic, because that's basically what WDYT? I think this behavior is what is expected. @CLOVIS-AI? I agree that the message in tracing is perhaps confusing, because that usage is not illegal. Sadly I don't think we can mutate the message of a |
Honestly, I'm having a really hard time understanding what this all entails. At a very high level, what I want is to provide my users with a maximally informative and minimally confusing stack-trace when a
Let me ask another question: we agree that the message of the top-level exception thrown in this case isn't helpful in this situation. However, if it was caused by another exception, that exception and its message would be useful. My question: is the stacktrace and other details (suppressed exceptions...) from the top-level exception meaningful? After all, I control what is displayed to the user. If everything from the exception is useful except for the message, I could just not print it. From what you've said, I'm understanding that the message is hard-coded in a way that it's 100% guaranteed it can never be anything different, so it would be safe to just ignore it, right? Or is there a risk that in some specific case the message is different and thus meaningful to the user? |
Also, very minor nitpick, but the error message has missing spaces after periods :)
|
I see in |
@nomisRev Sorry for the bump, do you know when you will have time to look at this? If you agree with my previous comments, I will just hide the message on my side and close this: https://gitlab.com/opensavvy/groundwork/prepared/-/merge_requests/61 |
I'm using Arrow 1.2.3.
I am writing a simple helper for Arrow Core that introduces a
Raise
context in which failures throwAssertionError
, with the goal of using it to simplify writing tests. Since this helper would only be used in automated tests that are expected not to fail, enabling tracing by default seems reasonable as it helps understand the root cause, so the performance impact is worth it.Using the following code:
I would expect this example to throw:
But, instead, it throws:
Is it indented that this is the error message generated by
traced
? If so, it's bit too worrying to be normal behavior. If not, is there something wrong on my end?The text was updated successfully, but these errors were encountered: