mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-06-08 20:25:19 +02:00
fix: improve error logging for indexing tasks across multiple connectors
- Updated error handling in the indexing functions for BookStack, Confluence, Google Calendar, Jira, Linear, and Luma connectors to log specific error messages when failures occur. - Enhanced logging for cases where no pages or events are found, providing clearer informational messages instead of treating them as critical errors. - Ensured consistent error reporting across all connector indexers, improving debugging and user feedback during indexing operations.
This commit is contained in:
parent
f4b1192a06
commit
5cf6fb15ed
6 changed files with 12 additions and 12 deletions
|
|
@ -136,10 +136,9 @@ async def index_bookstack_pages(
|
|||
)
|
||||
|
||||
if error:
|
||||
logger.error(f"Failed to get BookStack pages: {error}")
|
||||
|
||||
# Don't treat "No pages found" as an error that should stop indexing
|
||||
if "No pages found" in error:
|
||||
logger.info(f"No BookStack pages found: {error}")
|
||||
logger.info(
|
||||
"No pages found is not a critical error, continuing with update"
|
||||
)
|
||||
|
|
@ -159,6 +158,7 @@ async def index_bookstack_pages(
|
|||
)
|
||||
return 0, None
|
||||
else:
|
||||
logger.error(f"Failed to get BookStack pages: {error}")
|
||||
await task_logger.log_task_failure(
|
||||
log_entry,
|
||||
f"Failed to get BookStack pages: {error}",
|
||||
|
|
|
|||
|
|
@ -120,10 +120,9 @@ async def index_confluence_pages(
|
|||
)
|
||||
|
||||
if error:
|
||||
logger.error(f"Failed to get Confluence pages: {error}")
|
||||
|
||||
# Don't treat "No pages found" as an error that should stop indexing
|
||||
if "No pages found" in error:
|
||||
logger.info(f"No Confluence pages found: {error}")
|
||||
logger.info(
|
||||
"No pages found is not a critical error, continuing with update"
|
||||
)
|
||||
|
|
@ -147,6 +146,7 @@ async def index_confluence_pages(
|
|||
await confluence_client.close()
|
||||
return 0, None
|
||||
else:
|
||||
logger.error(f"Failed to get Confluence pages: {error}")
|
||||
await task_logger.log_task_failure(
|
||||
log_entry,
|
||||
f"Failed to get Confluence pages: {error}",
|
||||
|
|
|
|||
|
|
@ -243,10 +243,9 @@ async def index_google_calendar_events(
|
|||
)
|
||||
|
||||
if error:
|
||||
logger.error(f"Failed to get Google Calendar events: {error}")
|
||||
|
||||
# Don't treat "No events found" as an error that should stop indexing
|
||||
if "No events found" in error:
|
||||
logger.info(f"No Google Calendar events found: {error}")
|
||||
logger.info(
|
||||
"No events found is not a critical error, continuing with update"
|
||||
)
|
||||
|
|
@ -266,6 +265,7 @@ async def index_google_calendar_events(
|
|||
)
|
||||
return 0, None
|
||||
else:
|
||||
logger.error(f"Failed to get Google Calendar events: {error}")
|
||||
# Check if this is an authentication error that requires re-authentication
|
||||
error_message = error
|
||||
error_type = "APIError"
|
||||
|
|
|
|||
|
|
@ -126,10 +126,9 @@ async def index_jira_issues(
|
|||
)
|
||||
|
||||
if error:
|
||||
logger.error(f"Failed to get Jira issues: {error}")
|
||||
|
||||
# Don't treat "No issues found" as an error that should stop indexing
|
||||
if "No issues found" in error:
|
||||
logger.info(f"No Jira issues found: {error}")
|
||||
logger.info(
|
||||
"No issues found is not a critical error, continuing with update"
|
||||
)
|
||||
|
|
@ -149,6 +148,7 @@ async def index_jira_issues(
|
|||
)
|
||||
return 0, None
|
||||
else:
|
||||
logger.error(f"Failed to get Jira issues: {error}")
|
||||
await task_logger.log_task_failure(
|
||||
log_entry,
|
||||
f"Failed to get Jira issues: {error}",
|
||||
|
|
|
|||
|
|
@ -145,10 +145,9 @@ async def index_linear_issues(
|
|||
)
|
||||
|
||||
if error:
|
||||
logger.error(f"Failed to get Linear issues: {error}")
|
||||
|
||||
# Don't treat "No issues found" as an error that should stop indexing
|
||||
if "No issues found" in error:
|
||||
logger.info(f"No Linear issues found: {error}")
|
||||
logger.info(
|
||||
"No issues found is not a critical error, continuing with update"
|
||||
)
|
||||
|
|
@ -162,6 +161,7 @@ async def index_linear_issues(
|
|||
)
|
||||
return 0, None
|
||||
else:
|
||||
logger.error(f"Failed to get Linear issues: {error}")
|
||||
return 0, f"Failed to get Linear issues: {error}"
|
||||
|
||||
logger.info(f"Retrieved {len(issues)} issues from Linear API")
|
||||
|
|
|
|||
|
|
@ -179,10 +179,9 @@ async def index_luma_events(
|
|||
)
|
||||
|
||||
if error:
|
||||
logger.error(f"Failed to get Luma events: {error}")
|
||||
|
||||
# Don't treat "No events found" as an error that should stop indexing
|
||||
if "No events found" in error or "no events" in error.lower():
|
||||
logger.info(f"No Luma events found: {error}")
|
||||
logger.info(
|
||||
"No events found is not a critical error, continuing with update"
|
||||
)
|
||||
|
|
@ -202,6 +201,7 @@ async def index_luma_events(
|
|||
)
|
||||
return 0, None
|
||||
else:
|
||||
logger.error(f"Failed to get Luma events: {error}")
|
||||
await task_logger.log_task_failure(
|
||||
log_entry,
|
||||
f"Failed to get Luma events: {error}",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue