Fail loudly on invalid query params
- Dominant language
- JavaScript
- Stars
- 27.2k
- Forks
- 5.6k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 46
Description
:clipboard: **Description**
In #4273 I argued that the Shields way is to fail loudly when parameters are incorrect, rather than silently ignoring them. Descriptive error messages point the user as directly as possible to the source of the problem rather than leaving them to wonder.
In particular, it seems like a good idea to return descriptive errors for:
1. Invalid logos
2. Invalid color overrides
3. Styles we have never supported
4. Other query parameters which are of the incorrect type
- Though perhaps not, e.g. `cacheSeconds` which are too low
Contributor guide
Research direction
Start by reviewing the discussion in #4273 and the listed query-parameter cases. Define descriptive errors for invalid logos, color overrides, unsupported styles, and incorrectly typed parameters, while deciding how to handle values such as cacheSeconds that are too low; done means these cases fail visibly and consistently.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- api, backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100