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

Exceptions in predict are not propagated to the user #174

Open
IgnacioHeredia opened this issue Jul 23, 2024 · 0 comments
Open

Exceptions in predict are not propagated to the user #174

IgnacioHeredia opened this issue Jul 23, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@IgnacioHeredia
Copy link
Collaborator

When a module throws an Exception, the Exception is not forwarded to the user

def predict(**kwargs):
    raise Exception('Test exceptions')

--> Swagger output:

Response body:
500 Internal Server Error
Server got itself in trouble

At some point, I do remember the following approach worked for forwarding errors, but it no longer does:

from aiohttp.web import HTTPBadRequest

def predict(**kwargs):
    raise HTTPBadRequest(reason='Test exceptions')

Swagger seems frozen, and deepaas process throws the following error:

Exception in thread Thread-3:
Traceback (most recent call last):
  File "/home/iheredia/anaconda3/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/home/iheredia/anaconda3/lib/python3.8/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "/home/iheredia/anaconda3/lib/python3.8/multiprocessing/pool.py", line 576, in _handle_results
    task = get()
  File "/home/iheredia/anaconda3/lib/python3.8/multiprocessing/connection.py", line 251, in recv
    return _ForkingPickler.loads(buf.getbuffer())
TypeError: __init__() takes 1 positional argument but 2 were given
@IgnacioHeredia IgnacioHeredia added the bug Something isn't working label Jul 23, 2024
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

1 participant