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

@event does not propagate errors #286

Open
PGimenez opened this issue Aug 6, 2024 · 4 comments
Open

@event does not propagate errors #286

PGimenez opened this issue Aug 6, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@PGimenez
Copy link
Member

PGimenez commented Aug 6, 2024

When an error happens within an @event block, it is not printed and the block fails silently.

MWE:

using GenieFramework
@genietools

@app begin
    @in error = false
    @onbutton error begin
        println("Error ")
        a = nonexistantvar
        println("This will never be printed")
    end
    @event :error_event begin
        println("Error event")
        a = nonexistantvar
        println("This will never be printed")
    end
end

ui() = btn("Error 1", @click(:error)) * btn("Error 2", @on(:click, :error_event))

@page("/", ui)
up()

This is what is printed to the REPL:

Error
┌ Warning: 2024-08-06 10:42:01 UndefVarError(:nonexistantvar)
└ @ Stipple ~/.julia/packages/Stipple/Hr6Qa/src/Stipple.jl:999
Error event
@PGimenez PGimenez added the bug Something isn't working label Aug 6, 2024
@essenciary
Copy link
Member

@PGimenez The error is printed (granted as a warning) though? What would you expect to happen?

@PGimenez
Copy link
Member Author

PGimenez commented Aug 6, 2024

@PGimenez The error is printed (granted as a warning) though? What would you expect to happen?

I'm talking about the @event block. it prints Error event but it doesnt show an error when executing the a=nonexisttantvarline

@essenciary
Copy link
Member

I don't get it... it says here:

┌ Warning: 2024-08-06 10:42:01 UndefVarError(:nonexistantvar)
└ @ Stipple ~/.julia/packages/Stipple/Hr6Qa/src/Stipple.jl:999

@essenciary
Copy link
Member

Ah, that's from the other one... Thanks for making the example more complicated 😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants