Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Better error handling on typo'd ProductList filter #1399

Closed
sterlinghirsh opened this issue Feb 22, 2023 · 0 comments · Fixed by #1564
Closed

Better error handling on typo'd ProductList filter #1399

sterlinghirsh opened this issue Feb 22, 2023 · 0 comments · Fixed by #1564
Assignees
Labels
0 bug Something isn't working

Comments

@sterlinghirsh
Copy link
Member

Problem

When a ProductList in Strapi has a filter with a syntax error, the page crashes hard. At time of writing, https://www.ifixit.com/Tools/Xbox_Series_X_Wireless_Controller renders like
image

The filter string is:

(identifiers: 'IF145-472' OR 
identifiers: 'IF145-348' OR 
identifiers: 'IF145-335' OR 
(identifiers: 'IF145-077' OR 
identifiers: 'IF145-523' OR 
identifiers: 'IF145-307' OR 
identifiers: 'IF145-364' OR 
identifiers: 'IF317-092' OR 
identifiers: 'IF145-106' OR 
identifiers: 'IF145-238' OR 
identifiers: 'IF145-002' OR 
identifiers: 'IF145-027' OR 
identifiers: 'IF145-020') 

Note the extra ( on the fourth line. It's probably not possible to catch this before saving the ProductList without a lot of extra work, but we should handle it more gracefully on the frontend.

Do This

Catch the error that's presumably coming from Algolia, report a useful message in the console, show a no-results or error page.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
0 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants