mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-01 20:03:30 +02:00
fix reauth error handling and stale log messages
This commit is contained in:
parent
45b784cda6
commit
30ab464ba7
4 changed files with 21 additions and 5 deletions
|
|
@ -86,7 +86,7 @@ def create_delete_google_drive_file_tool(
|
|||
}
|
||||
|
||||
logger.info(
|
||||
f"Requesting approval for trashing Google Drive file: '{file_name}' (file_id={file_id}, delete_from_kb={delete_from_kb})"
|
||||
f"Requesting approval for deleting Google Drive file: '{file_name}' (file_id={file_id}, delete_from_kb={delete_from_kb})"
|
||||
)
|
||||
approval = interrupt(
|
||||
{
|
||||
|
|
@ -157,7 +157,7 @@ def create_delete_google_drive_file_tool(
|
|||
}
|
||||
|
||||
logger.info(
|
||||
f"Trashing Google Drive file: file_id='{final_file_id}', connector={final_connector_id}"
|
||||
f"Deleting Google Drive file: file_id='{final_file_id}', connector={final_connector_id}"
|
||||
)
|
||||
client = GoogleDriveClient(session=db_session, connector_id=connector.id)
|
||||
try:
|
||||
|
|
@ -174,7 +174,7 @@ def create_delete_google_drive_file_tool(
|
|||
}
|
||||
raise
|
||||
|
||||
logger.info(f"Google Drive file trashed: file_id={final_file_id}")
|
||||
logger.info(f"Google Drive file deleted (moved to trash): file_id={final_file_id}")
|
||||
|
||||
trash_result: dict[str, Any] = {
|
||||
"status": "success",
|
||||
|
|
@ -219,7 +219,7 @@ def create_delete_google_drive_file_tool(
|
|||
if isinstance(e, GraphInterrupt):
|
||||
raise
|
||||
|
||||
logger.error(f"Error trashing Google Drive file: {e}", exc_info=True)
|
||||
logger.error(f"Error deleting Google Drive file: {e}", exc_info=True)
|
||||
return {
|
||||
"status": "error",
|
||||
"message": "Something went wrong while trashing the file. Please try again.",
|
||||
|
|
|
|||
|
|
@ -297,7 +297,7 @@ BUILTIN_TOOLS: list[ToolDefinition] = [
|
|||
requires=["db_session", "search_space_id", "user_id"],
|
||||
),
|
||||
# =========================================================================
|
||||
# GOOGLE DRIVE TOOLS - create files, trash files
|
||||
# GOOGLE DRIVE TOOLS - create files, delete files
|
||||
# =========================================================================
|
||||
ToolDefinition(
|
||||
name="create_google_drive_file",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue