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

Error not being thrown when there is a bug in a Prc #50

Open
hdavid16 opened this issue Apr 27, 2023 · 2 comments
Open

Error not being thrown when there is a bug in a Prc #50

hdavid16 opened this issue Apr 27, 2023 · 2 comments
Milestone

Comments

@hdavid16
Copy link
Member

See: #49 (comment)

There is an error in the original function used to create a Prc (with the @process macro). However, the error is never thrown. @pbayer any thoughts?

@pbayer pbayer added this to the 0.4 milestone Jul 12, 2023
@hdavid16
Copy link
Member Author

hdavid16 commented Aug 4, 2023

Here is a MWE:

using DiscreteEvents
function time(c)
    @delay c 1
    println("Time is $(c.time)")
    error("random error")
end
c = Clock()
process!(c, Prc(time))
run!(c, 10)

The simulation ends at the error with no error thrown. Commenting the error will run the time function every 1 unit until 10 units are simulated.

@hdavid16
Copy link
Member Author

hdavid16 commented Aug 4, 2023

I have pinpointed where the issue occurs:

_evaluate(ev.ex)

When the error is not present, a new event is scheduled for t = 2 when _evaluate is called. When the error is present, the error is not thrown and the new event is not scheduled for t = 2.
This is as far as I can go with the debugger. Any thoughts @pbayer ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants