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 is silent and ignored in cron #216

Closed
mzy2240 opened this issue Sep 10, 2024 · 2 comments · Fixed by #219
Closed

error is silent and ignored in cron #216

mzy2240 opened this issue Sep 10, 2024 · 2 comments · Fixed by #219
Assignees

Comments

@mzy2240
Copy link

mzy2240 commented Sep 10, 2024

When scheduling a function using cron, it does not throw error or log anything if failed

module JuliaWebServer 
using Oxygen
using HTTP

@get "/greet" function(req::HTTP.Request)
    return "hello world!"
end

@cron "*/2" function error_msg()::Nothing
    throw("ERROR")
    return
end

serve()
end

image

@ndortega
Copy link
Member

I think this is the result of me not nesting the try catch deeply enough and the @async macro is silently handling the error:

https://github.com/OxygenFramework/Oxygen.jl/blob/master/src/cron.jl#L102-L107

@mzy2240
Copy link
Author

mzy2240 commented Sep 11, 2024

ic. maybe this is helpful to address the issue? JuliaLang/julia#36854

@ndortega ndortega self-assigned this Sep 15, 2024
@ndortega ndortega linked a pull request Sep 15, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

2 participants