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

No Error Being Caught if Process has one #60

Closed
jjd35 opened this issue Jan 13, 2024 · 1 comment
Closed

No Error Being Caught if Process has one #60

jjd35 opened this issue Jan 13, 2024 · 1 comment

Comments

@jjd35
Copy link

jjd35 commented Jan 13, 2024

I noticed that if there is an error in a Prc() Function, that Discrete Events just continues through the simulation without any indication there was a problem.

Here is an example:

#start of test.jl
using DiscreteEvents, Printf

function errorProcess(c::Clock)
    @printf("I'm going to have an error\n")
    error("Found Error")
end


function noErrorProcess(c::Clock)
    @printf("I'm running fine\n")
    delay!(c,0.001)
end
errorPrc = Prc(1,errorProcess)
goodPRc = Prc(2,noErrorProcess)
c = Clock()

process!(c, errorPrc,10)
process!(c,goodPRc,10)
@run! c 0.1

And here is the console output:

julia> include("test.jl")
I'm going to have an error
I'm running fine
I'm running fine
I'm running fine
I'm running fine
I'm running fine
I'm running fine
I'm running fine
I'm running fine
I'm running fine
I'm running fine
"run! finished with 10 clock events, 0 sample steps, simulation time: 0.1"

Is there an easy fix here so that it will actually show the error? Also I haven't found a way to get the debugger to actually break in process! functions.

@hdavid16
Copy link
Member

Yes. This is a known issue: #50

@hdavid16 hdavid16 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 14, 2024
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