badges / badges/shields

Fail loudly on invalid query params

Open
#4,274 2 comments 1 reaction 0 assignees View on GitHub
core
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.