Skip to content

Log full error object in interactions endpoint catch block#25

Merged
ELMOURABEA merged 2 commits into
mainfrom
copilot/fix-error-logging-in-catch
Nov 19, 2025
Merged

Log full error object in interactions endpoint catch block#25
ELMOURABEA merged 2 commits into
mainfrom
copilot/fix-error-logging-in-catch

Conversation

Copilot AI commented Nov 19, 2025

Copy link
Copy Markdown
Contributor

Error handling in the interactions endpoint was logging only err.message, losing critical debugging information like stack traces and error properties in production.

Changes

  • Updated error logging in /routes/interactions.js to log the full error object

Before:

} catch (err) {
    console.error('Interaction check failed:', err.message);
    res.status(502).json({ error: 'Interaction check failed' });
}

After:

} catch (err) {
    console.error('Interaction check failed:', err);
    res.status(502).json({ error: 'Interaction check failed' });
}

This provides complete error context (stack trace, properties, nested errors) for production debugging.

Original prompt

This section details on the original issue you should resolve

<issue_title>high</issue_title>
<issue_description>high

The error handling in the catch block is incomplete. While returning a 500 status is correct, the actual error object (err) is not being logged. This makes debugging failures in production extremely difficult. You should always log the error details.

} catch (err) {
    console.error('Interaction check failed:', err);
    res.status(500).json({ error: 'Interaction check failed'});
}

Originally posted by @gemini-code-assist[bot] in #11 (comment)
</issue_description>

Comments on the Issue (you are @copilot in this section)

@ELMOURABEA UP

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@ELMOURABEA ELMOURABEA marked this pull request as ready for review November 19, 2025 06:45
Copilot AI review requested due to automatic review settings November 19, 2025 06:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: ELMOURABEA <189882272+ELMOURABEA@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix incomplete error handling in catch block Log full error object in interactions endpoint catch block Nov 19, 2025
Copilot AI requested a review from ELMOURABEA November 19, 2025 06:50
@ELMOURABEA ELMOURABEA merged commit ba55722 into main Nov 19, 2025
7 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

![high](https://www.gstatic.com/codereviewagent/high-priority.svg)

3 participants