{"record":{"id":"2a814c4d2a569ab4","repo":"pear-devs/pear-desktop","slug":"bad-httpstatus-response-statustext-2a814c","errorCode":null,"errorMessage":"bad HTTPStatus(${response.statusText})","messagePattern":"bad HTTPStatus\\((.+?)\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/plugins/synced-lyrics/providers/Megalobiz.ts","lineNumber":32,"sourceCode":"    .replace(/\\s+by$/, '');\n};\n\nexport class Megalobiz implements LyricProvider {\n  public name = 'Megalobiz';\n  public baseUrl = 'https://www.megalobiz.com';\n  private domParser = new DOMParser();\n\n  // prettier-ignore\n  async search({ title, artist, songDuration }: SearchSongInfo): Promise<LyricResult | null> {\n    const query = new URLSearchParams({\n      qry: `${artist} ${title}`,\n    });\n\n    const response = await fetch(`${this.baseUrl}/search/all?${query}`, {\n      signal: AbortSignal.timeout(5_000),\n    });\n    if (!response.ok) {\n      throw new Error(`bad HTTPStatus(${response.statusText})`);\n    }\n\n    const data = await response.text();\n    const searchDoc = this.domParser.parseFromString(data, 'text/html');\n\n    // prettier-ignore\n    const searchResults: MegalobizSearchResult[] = Array.prototype.map\n      .call(searchDoc.querySelectorAll('a.entity_name[href^=\"/lrc/maker/\"][name][title]'),\n        (anchor: HTMLAnchorElement) => {\n          const { minutes, seconds, millis } = anchor\n            .getAttribute('title')!\n            .match(/\\[(?<minutes>\\d+):(?<seconds>\\d+)\\.(?<millis>\\d+)\\]/)!\n            .groups!;\n\n          let name = anchor.getAttribute('name')!;\n\n          const artists = [\n            removeNoise(name.match(/\\(?[Ff]eat\\. (.+)\\)?/)?.[1] ?? ''),","sourceCodeStart":14,"sourceCodeEnd":50,"githubUrl":"https://github.com/pear-devs/pear-desktop/blob/1e2aac5706c870c93ed74ba8727ae8390d3b0fa5/src/plugins/synced-lyrics/providers/Megalobiz.ts#L14-L50","documentation":"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.","triggerScenarios":"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.","commonSituations":"Megalobiz (a smaller lyrics site) having poor uptime; network restrictions; batch lyric lookups; mobile/high-latency networks where the site struggles.","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"],"exampleFix":"// before\nconst r = await megalobiz.search(info);\n\n// after\ntry { return await megalobiz.search(info); }\ncatch (e) { if (!/bad HTTPStatus/.test(e.message)) throw e; return await lrclib.search(info); }","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { return await megalobiz.search(info); } catch (e) {\n  if (/bad HTTPStatus/.test(e.message)) return await lrclib.search(info);\n  throw e;\n}","preventionTips":["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"],"tags":["lyrics","megalobiz","http","network","timeout"],"backgroundTag":"http-error-response","analyzedSha":"1e2aac5706c870c93ed74ba8727ae8390d3b0fa5","analyzedAt":"2026-08-27T20:01:08.614Z","schemaVersion":2},"datasetVersion":"2026-08-28T00:17:15.603Z"}