Skip to content

Commit e8470fc

Browse files
committed
Log SIWA escalation failure error message (#7740)
<!-- ## title your PR with this format: "[SDK/Dashboard/Portal] Feature/Fix: Concise title for the changes" If you did not copy the branch name from Linear, paste the issue tag here (format is TEAM-0000): ## Notes for the reviewer Anything important to call out? Be sure to also clarify these in your comments. ## How to test Unit tests, playground, etc. --> <!-- start pr-codex --> --- ## PR-Codex overview This PR focuses on enhancing error handling in the `createSupportTicket` function within the `support.ts` file. It ensures that even if the feedback submission fails, the ticket creation process continues without interruption. ### Detailed summary - Changed the variable `res` to store the result of the `fetch` call to the SIWA URL. - Added an error handling block to log an error message if the `fetch` response is not OK, without failing the ticket creation process. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved error handling for support ticket escalation, ensuring errors are logged if escalation fails without interrupting ticket creation. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent a6483f4 commit e8470fc

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

apps/dashboard/src/@/api/support.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export async function createSupportTicket(params: {
6161
try {
6262
const siwaUrl = process.env.NEXT_PUBLIC_SIWA_URL;
6363
if (siwaUrl) {
64-
await fetch(`${siwaUrl}/v1/chat/feedback`, {
64+
const res = await fetch(`${siwaUrl}/v1/chat/feedback`, {
6565
method: "POST",
6666
headers: {
6767
"Content-Type": "application/json",
@@ -73,6 +73,12 @@ export async function createSupportTicket(params: {
7373
feedbackRating: ESCALATION_FEEDBACK_RATING,
7474
}),
7575
});
76+
77+
if (!res.ok) {
78+
// Log error but don't fail the ticket creation
79+
const errorMessage = await res.text();
80+
console.error("Failed to escalate to SIWA feedback:", errorMessage);
81+
}
7682
}
7783
} catch (error) {
7884
// Log error but don't fail the ticket creation

0 commit comments

Comments
 (0)