pear-devs/pear-desktop · error · Error
bad HTTPStatus(${response.statusText})
Error message
bad HTTPStatus(${response.statusText}) What it means
The Megalobiz lyrics provider performs a search request with a 5-second timeout; any non-OK HTTP status throws 'bad HTTPStatus(<statusText>)'. Note AbortSignal.timeout means requests exceeding 5s reject with a TimeoutError (a different error) — this one specifically covers HTTP-level failures.
Source
Thrown at src/plugins/synced-lyrics/providers/Megalobiz.ts:32
.replace(/\s+by$/, '');
};
export class Megalobiz implements LyricProvider {
public name = 'Megalobiz';
public baseUrl = 'https://www.megalobiz.com';
private domParser = new DOMParser();
// prettier-ignore
async search({ title, artist, songDuration }: SearchSongInfo): Promise<LyricResult | null> {
const query = new URLSearchParams({
qry: `${artist} ${title}`,
});
const response = await fetch(`${this.baseUrl}/search/all?${query}`, {
signal: AbortSignal.timeout(5_000),
});
if (!response.ok) {
throw new Error(`bad HTTPStatus(${response.statusText})`);
}
const data = await response.text();
const searchDoc = this.domParser.parseFromString(data, 'text/html');
// prettier-ignore
const searchResults: MegalobizSearchResult[] = Array.prototype.map
.call(searchDoc.querySelectorAll('a.entity_name[href^="/lrc/maker/"][name][title]'),
(anchor: HTMLAnchorElement) => {
const { minutes, seconds, millis } = anchor
.getAttribute('title')!
.match(/\[(?<minutes>\d+):(?<seconds>\d+)\.(?<millis>\d+)\]/)!
.groups!;
let name = anchor.getAttribute('name')!;
const artists = [
removeNoise(name.match(/\(?[Ff]eat\. (.+)\)?/)?.[1] ?? ''),View on GitHub (pinned to 1e2aac5706)
Solutions
- Fall back to LRCLib or Genius when Megalobiz fails (it's a secondary provider)
- Retry once — transient failures are common on this host
- If it persists, temporarily disable the Megalobiz provider in plugin config
- Verify the site is reachable in a browser
Example fix
// before
const r = await megalobiz.search(info);
// after
try { return await megalobiz.search(info); }
catch (e) { if (!/bad HTTPStatus/.test(e.message)) throw e; return await lrclib.search(info); } Defensive patterns
Strategy: fallback
Try / catch
try { return await megalobiz.search(info); } catch (e) {
if (/bad HTTPStatus/.test(e.message)) return await lrclib.search(info);
throw e;
} Prevention
- Treat Megalobiz as best-effort; prefer LRCLib first
- Retry once — the host has flaky uptime
- Respect the 5s timeout: slow networks will fail; increase tolerance by using faster networks or skipping the provider
When it happens
Trigger: megalobiz.com being slow/down or returning 5xx; 4xx statuses; rate limiting; proxy/firewall interference. Timeout >5s surfaces as a TimeoutError instead, but flaky slow servers often produce both.
Common situations: Megalobiz (a smaller lyrics site) having poor uptime; network restrictions; batch lyric lookups; mobile/high-latency networks where the site struggles.
Understand the failure class
Background: "API error: {status}" and "HTTP 401/403/404/429/5xx" errors: non-2xx HTTP responses explained — this error's family across 27 libraries.
Related errors
- bad HTTPStatus(${response.statusText})
- Failed to extract lyrics from page.
- Expected an array, instead got ${typeof data}
- Failed to extract lyrics from preloaded state.
- Failed to get token
AI-assisted analysis of pear-devs/pear-desktop@1e2aac5706 (2026-08-27).
Data as JSON: /api/errors/2a814c4d2a569ab4.
Report an issue: GitHub.