-
Notifications
You must be signed in to change notification settings - Fork 46
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
Debugging: Line numbers and originating signal #118
Comments
Great idea. As far as I understand the @LINE macro talks about the line number where it is invoked. So there may not be an easy way to do this without additional macro-based API. For example, it would be possible with something like:
|
Unfortunately returning an expression with
Gives (2,4) See this issue: JuliaLang/julia#9577 So, given that, not sure if a One thing that could be done though is to add keyword arguments, something like: I think possibly a better solution for now would be to add the ability to name nodes. I have this in this branch: https://github.com/JobJob/Reactive.jl/tree/named_signals Usage like so:
You get the error:
You can use |
@JobJob I think naming Signals is a good idea in order to improve debugging experience! Can you make a PR? |
Ok but it prob needs a bit of review, from memory I was fairly slapdash about getting it up and running. |
Just a comment , what generates errors are the actions not the signals .. so maybe it would be better to name actions. |
Yep, you make a good point. As it turns out, each action is effectively associated with just one particular Signal/Node (the action's recipient), so reporting that node on error should be ok. |
The annoyance of not being able to use |
That's great! |
Another sketchy trick the macro could expand to:
|
I've got a PR in progress to solve this, if anyone feels like trying it out: |
Just to provide clarity, how should I interpret the following message when my code only has 149 lines of code:
|
I find it is very hard to track down error messages when something goes wrong (failed to push!)
My suggestion is to encode line numbers in the signal definition so the error message would look like:
Error: failed to push!
[from] signal defined in: (line number of originating signal)
[to] signal defined in :(line number of receiving signal)
error message: message
And display only the first occurrence of error instead of flooding the console with subsequent errors.
The text was updated successfully, but these errors were encountered: