Files
galaxy/test
mvdbeek ec576b8eac Serialize message exceptions on execution error
This fixes handling of `ToolInputsNotOK` exceptions, which would fail
with
```
Message
Uncaught exception in exposed API method:
Stack Trace

Newest

TypeError: Object of type ToolInputsNotOKException is not JSON serializable
  File "galaxy/util/json.py", line 74, in safe_dumps
    dumped = json.dumps(obj, allow_nan=False, **kwargs)
  File "__init__.py", line 238, in dumps
    **kw).encode(obj)
  File "json/encoder.py", line 200, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "json/encoder.py", line 258, in iterencode
    return _iterencode(o, 0)
  File "json/encoder.py", line 180, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type ToolInputsNotOKException is not JSON serializable
  File "galaxy/web/framework/decorators.py", line 350, in decorator
    rval = format_return_as_json(rval, jsonp_callback, pretty=trans.debug)
  File "galaxy/web/framework/decorators.py", line 387, in format_return_as_json
    json = safe_dumps(rval, **dumps_kwargs)
  File "galaxy/util/json.py", line 77, in safe_dumps
    dumped = json.dumps(obj, allow_nan=False, **kwargs)
  File "__init__.py", line 238, in dumps
    **kw).encode(obj)
  File "json/encoder.py", line 200, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "json/encoder.py", line 258, in iterencode
    return _iterencode(o, 0)
  File "json/encoder.py", line 180, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
```

This also required making the tool form error modal dependent on the
returned errors, instead of only popping up on non-200 status codes
or if all jobs failed.

Fixes https://github.com/galaxyproject/galaxy/issues/19482
2025-01-30 09:43:55 +01:00
..
2023-01-26 13:45:42 -05:00