Skip to content

Commit

Permalink
fix(feedback): Improve feedback error message (#12647)
Browse files Browse the repository at this point in the history
Fix error message colour back to red. Also updated the default error
message to include information about network issues and ad blockers
since ad blockers can result in a type error which has no status code.
  • Loading branch information
c298lee authored Jun 26, 2024
1 parent 1092d77 commit aafb4e7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 3 additions & 1 deletion packages/feedback/src/core/sendFeedback.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,9 @@ describe('sendFeedback', () => {
email: 're@example.org',
message: 'mi',
}),
).rejects.toMatch('Unable to send Feedback. Invalid response from server.');
).rejects.toMatch(
'Unable to send Feedback. This could be because of network issues, or because you are using an ad-blocker',
);
});

it('handles 0 transport error', async () => {
Expand Down
4 changes: 3 additions & 1 deletion packages/feedback/src/core/sendFeedback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ export const sendFeedback: SendFeedback = (
);
}

return reject('Unable to send Feedback. Invalid response from server.');
return reject(
'Unable to send Feedback. This could be because of network issues, or because you are using an ad-blocker',
);
});
});
};
Expand Down
4 changes: 2 additions & 2 deletions packages/feedback/src/modal/components/Dialog.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ const FORM = `
}
.form__error-container {
color: var(--error-foreground);
fill: var(--error-foreground);
color: var(--error-color);
fill: var(--error-color);
}
.form__label {
Expand Down

0 comments on commit aafb4e7

Please sign in to comment.