correctly format traceback when logging errors
This commit is contained in:
parent
3fc16804fe
commit
7780bbed2a
4 changed files with 4 additions and 4 deletions
|
|
@ -285,7 +285,7 @@ class Autopilot(ContinueBaseModel):
|
|||
e.__class__, ContinueCustomException)
|
||||
|
||||
error_string = e.message if is_continue_custom_exception else '\n'.join(
|
||||
traceback.format_tb(e.__traceback__)) + f"\n\n{e.__repr__()}"
|
||||
traceback.format_exception(e))
|
||||
error_title = e.title if is_continue_custom_exception else get_error_title(
|
||||
e)
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ def create_async_task(coro: Coroutine, unique_id: Union[str, None] = None):
|
|||
except Exception as e:
|
||||
print("Exception caught from async task: ", e)
|
||||
capture_event(unique_id or "None", "async_task_error", {
|
||||
"error_title": e.__str__() or e.__repr__(), "error_message": traceback.format_tb(e.__traceback__)
|
||||
"error_title": e.__str__() or e.__repr__(), "error_message": traceback.format_exception(e)
|
||||
})
|
||||
|
||||
task.add_done_callback(callback)
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ async def websocket_endpoint(websocket: WebSocket, session: Session = Depends(we
|
|||
except Exception as e:
|
||||
print("ERROR in gui websocket: ", e)
|
||||
capture_event(session.autopilot.continue_sdk.ide.unique_id, "gui_error", {
|
||||
"error_title": e.__str__() or e.__repr__(), "error_message": traceback.format_tb(e.__traceback__)})
|
||||
"error_title": e.__str__() or e.__repr__(), "error_message": traceback.format_exception(e)})
|
||||
raise e
|
||||
finally:
|
||||
print("Closing gui websocket")
|
||||
|
|
|
|||
|
|
@ -414,6 +414,6 @@ async def websocket_endpoint(websocket: WebSocket):
|
|||
except Exception as e:
|
||||
print("Error in ide websocket: ", e)
|
||||
capture_event(ideProtocolServer.unique_id, "gui_error", {
|
||||
"error_title": e.__str__() or e.__repr__(), "error_message": traceback.format_tb(e.__traceback__)})
|
||||
"error_title": e.__str__() or e.__repr__(), "error_message": traceback.format_exception(e)})
|
||||
await websocket.close()
|
||||
raise e
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue