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

How to avoid abort when the code throw an Exception #2920

Closed
1 task
Huelse opened this issue Feb 21, 2024 · 1 comment
Closed
1 task

How to avoid abort when the code throw an Exception #2920

Huelse opened this issue Feb 21, 2024 · 1 comment
Labels

Comments

@Huelse
Copy link

Huelse commented Feb 21, 2024

Link to code

No response

Proposal

code:

@app.post("/evaluate", name="evaluate")
async def handler(request):
    # load from ctypes cdll
    app.ctx.lib.evaluate()

logs:

[2024-02-21 02:43:17 +0000] - (sanic.access)[INFO][192.168.65.1:59074]: POST http://localhost:8000/edcc/create  500 579
terminate called after throwing an instance of 'cv::Exception'
  what():  OpenCV(4.8.1) /opt/opencv-4.8.1/modules/imgcodecs/src/loadsave.cpp:802: error: (-215:Assertion failed) !buf.empty() in function 'imdecode_'

This will abort the worker(thread), and I can't use try-except to handle it. I want to ignore it and keep the worker going on or catch the exception and return in json, not abort it.

Thanks a lot!

Additional context

No response

Is this a breaking change?

  • Yes
@Huelse Huelse added the RFC label Feb 21, 2024
@Huelse
Copy link
Author

Huelse commented Mar 4, 2024

good-for-nothing

@Huelse Huelse closed this as not planned Won't fix, can't repro, duplicate, stale Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant