Skip to content

Commit

Permalink
Revert "pretty print"
Browse files Browse the repository at this point in the history
This reverts commit 0912538.
  • Loading branch information
girarda committed Dec 22, 2022
1 parent 0912538 commit b6f62d6
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ async def read_stream(self, stream_read_request_body: StreamReadRequestBody = Bo
# TODO: We're temporarily using FastAPI's default exception model. Ideally we should use exceptions defined in the OpenAPI spec
raise HTTPException(
status_code=400,
detail=f"Could not perform read with with error: {error.args[0]}\n{self._get_stacktrace_as_string(error)}",
detail=f"Could not perform read with with error: {error.args[0]}\n{''.join(traceback.TracebackException.from_exception(error).format())}",
)

return StreamRead(logs=log_messages, slices=[single_slice])
Expand Down Expand Up @@ -212,9 +212,5 @@ def _create_low_code_adapter(manifest: Dict[str, Any]) -> LowCodeSourceAdapter:
# TODO: We're temporarily using FastAPI's default exception model. Ideally we should use exceptions defined in the OpenAPI spec
raise HTTPException(
status_code=400,
detail=f"Invalid connector manifest with error: {error.message}\n{DefaultApiImpl._get_stacktrace_as_string(error)}",
detail=f"Invalid connector manifest with error: {error.message}\n{''.join(traceback.TracebackException.from_exception(error).format())}",
)

@staticmethod
def _get_stacktrace_as_string(error) -> str:
return "\n".join(traceback.TracebackException.from_exception(error).format())

0 comments on commit b6f62d6

Please sign in to comment.