Skip to content

Conversation

@iceljc
Copy link
Collaborator

@iceljc iceljc commented Feb 4, 2026

PR Type

Bug fix


Description

  • Include exception object in LogError call for better diagnostics

  • Enables proper exception details in error logs


Diagram Walkthrough

flowchart LR
  A["LogError call"] -->|"Add exception object"| B["Enhanced error logging"]
  B -->|"Includes stack trace"| C["Better diagnostics"]
Loading

File Walkthrough

Relevant files
Bug fix
MembaseGraphDb.cs
Add exception parameter to error logging                                 

src/Plugins/BotSharp.Plugin.Membase/GraphDb/MembaseGraphDb.cs

  • Modified LogError call to include exception object as first parameter
  • Changed from LogError(message) to LogError(ex, message) pattern
  • Enables logging of full exception details including stack trace
+1/-1     

@qodo-code-review
Copy link

qodo-code-review bot commented Feb 4, 2026

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@iceljc iceljc merged commit ef46a85 into SciSharp:master Feb 4, 2026
3 of 4 checks passed
@qodo-code-review
Copy link

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
Possible issue
Re-throw exceptions to avoid silent failures

In the catch block, re-throw the exception after logging it instead of returning
a new empty GraphQueryResult. This prevents swallowing the exception and ensures
calling code is aware of the failure.

src/Plugins/BotSharp.Plugin.Membase/GraphDb/MembaseGraphDb.cs [49-53]

 catch (Exception ex)
 {
     _logger.LogError(ex, $"Error when querying {Provider} graph db.");
-    return new();
+    throw;
 }
  • Apply / Chat
Suggestion importance[1-10]: 9

__

Why: This suggestion correctly identifies a critical issue where an exception is swallowed, which can lead to silent failures that are hard to debug. Re-throwing the exception is the correct pattern for error handling in this context.

High
General
Use structured logging placeholders

Refactor the _logger.LogError call to use structured logging placeholders
instead of string interpolation. Include the GraphId in the log message for
better diagnostics.

src/Plugins/BotSharp.Plugin.Membase/GraphDb/MembaseGraphDb.cs [51]

-_logger.LogError(ex, $"Error when querying {Provider} graph db.");
+_logger.LogError(
+    ex,
+    "Error querying {Provider} graphdb for GraphId: {GraphId}",
+    Provider,
+    options.GraphId);
  • Apply / Chat
Suggestion importance[1-10]: 5

__

Why: The suggestion correctly promotes the use of structured logging, which is a best practice that improves log querying and performance. It also enriches the log message with the GraphId for better context.

Low
  • More

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant