Skip to content

Exceptions in predict are not propagated to the user #174

@IgnacioHeredia

Description

@IgnacioHeredia

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions