anuraghazra / anuraghazra/github-readme-stats

bug: passing a wrong theme now causes 500 Internal Error

Open
#4,641 14 comments 10 reactions 0 assignees View on GitHub
:star: top bug bug
Dominant language
JavaScript
Stars
79.8k
Forks
37.7k
PR merge metrics
No merged PRs in 30d

Description

### Describe the bug

When passing a theme that does not exist in query params (`theme=...`), I get the following error:

```
500: INTERNAL_SERVER_ERROR
Code: FUNCTION_INVOCATION_FAILED
ID: fra1::hrdcg-1762421377288-2993a3767f96
```

### Expected behavior

I'd like to have the default theme as a fallback.

### Screenshots / Live demo link

[https://github-readme-stats.vercel.app/api?username=mikyll&show_icons=not&**theme=foobar**](https://github-readme-stats.vercel.app/api?username=mikyll&show_icons=not&theme=foobar)

Image

### Additional context

I noticed this some day ago, so I think this bug was mistakenly introduced with most recent commits

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the linked API request with an invalid theme query parameter, then trace where the theme is selected and where the default is applied. Done means an unknown theme returns a response using the default theme instead of a 500 Internal Error; add or update coverage if the relevant tests are found.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.