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

Errors not very helpful for debugging #72

Closed
noozo opened this issue Oct 26, 2023 · 3 comments
Closed

Errors not very helpful for debugging #72

noozo opened this issue Oct 26, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@noozo
Copy link

noozo commented Oct 26, 2023

Trying out reactor for the first time, so take it with a grain of salt, but a couple of things i noticed when error handling:

  • No easy way to know which step err'ed, as the result is usually {:error, [some error]}
  • No access to stacktrace when debugging, which is annoying when debugging. For instance, i just got this ** (MatchError) no match of right hand side value: {:error, [%BadMapError{term: nil}]} and i have no clue where that happened. The only hint i get is that somewhere i tried to access a bad term inside a map.

Would it be feasible for [errors] to actually be a map or error struct, for instance, with %{errors: errors, stacktrace: stacktrace, ...}, or at least provide that as a 3rd element of the error tuple (which sucks, i know, but would help debugging a ton)?

@noozo noozo added the enhancement New feature or request label Oct 26, 2023
@jimsynz
Copy link
Contributor

jimsynz commented Oct 26, 2023

You're right. I was in a hurry to get back onto some client work, so I didn't really think this part through as much as I'd like. I'm interested in what you think the ideal failure result would look like? Maybe @zachdaniel has some ideas too?

@zachdaniel
Copy link
Contributor

zachdaniel commented Oct 26, 2023

We've talked about standardizing some of the concepts from Ash.Error into its own package, and then using it in both places. The main idea is to use "Error classes" and standardized exceptions that capture the stacktrace at the place they were created. We'd have to start somewhere practical for this. We could extract the basics of that system out (which we decided to call splode IIRC) and include a metadata key where the step that generated it could be included.

@jimsynz
Copy link
Contributor

jimsynz commented Mar 18, 2024

Hopefully the changes in #97 should improve this situation greatly.

@jimsynz jimsynz closed this as completed Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants