Skip to content
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

Use ExceptionStack instead of CapturedException for Distributed and asyncmap #79

Open
vchuravy opened this issue Jan 8, 2022 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@vchuravy
Copy link
Sponsor Member

vchuravy commented Jan 8, 2022

Could we potentially make use of the exception stack here now?

    catch
        close(chnl)
        retval = Base.ExceptionStack(Any[capture_exception(ex...) for ex in current_exceptions()])
    end

Originally posted by @vtjnash in JuliaLang/julia#42105 (comment)

@vchuravy vchuravy added the help wanted Extra attention is needed label Jan 8, 2022
@DilumAluthge DilumAluthge changed the title Use ExceptionStack instead of CapturedException for Distributed and asyncmap` Use ExceptionStack instead of CapturedException for Distributed and asyncmap Jan 11, 2022
@NHDaly
Copy link
Member

NHDaly commented Apr 4, 2023

Excellent point Valentin. It seems like the ExceptionStack object itself isn't enough, since we probably want to have something that still <: Exception, so that it can e.g. be used to close(::Channel, ::Exception).

Would one of these two options make sense?:

  1. Introduce a new type, similar to CapturedException, which captures an entire catch stack? Like:
    •  struct CapturedExceptionStackException <: Exception
           catch_stack::Vector{Any}
       end
      • (Clearly naming things is not my strong suit)
  2. Or, change the CapturedException implementation to hold a catch stack instead of the current exception + backtrace?
    • But i think this is probably a breaking change, and therefore not an acceptable option.

Maybe the name for the first one could be CapturedCatchStack <: Exception? Or CapturedExceptionStack <: Exception?

@NHDaly
Copy link
Member

NHDaly commented Apr 27, 2023

On the other hand, ideally the fields of a struct like this really shouldn't be part of the API of the stdlib. It shouldn't be a breaking change to change them, as long as we keep the existing method behaviors the same.. :/ But i know that this isn't the reality of how things work since julia doesn't have any encapsulation or private/public. :/

Do you have a preference here, @vchuravy?

@vtjnash vtjnash transferred this issue from JuliaLang/julia Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants