Finish datasheet acquisition: more vendors, Mouser, browser download links.
Add Microchip/Murata/Silicon Labs URL tables, optional Mouser search, and suggested URLs on a miss so the wizard can open PDFs in the user's browser when the VPS is blocked. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -934,12 +934,19 @@ export async function resolveLcscPassive(
|
||||
|
||||
export class DatasheetFetchError extends Error {
|
||||
url: string | null;
|
||||
urls: string[];
|
||||
source: string | null;
|
||||
constructor(message: string, url: string | null, source: string | null = null) {
|
||||
constructor(
|
||||
message: string,
|
||||
url: string | null,
|
||||
source: string | null = null,
|
||||
urls: string[] = [],
|
||||
) {
|
||||
super(message);
|
||||
this.name = "DatasheetFetchError";
|
||||
this.url = url;
|
||||
this.source = source;
|
||||
this.urls = urls.length ? urls : url ? [url] : [];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -963,6 +970,7 @@ export async function fetchAutoDatasheet(
|
||||
err.detail || "Failed to fetch datasheet",
|
||||
err.url ?? null,
|
||||
err.source ?? null,
|
||||
Array.isArray(err.urls) ? err.urls.filter((u: unknown) => typeof u === "string") : [],
|
||||
);
|
||||
}
|
||||
const url = res.headers.get("X-Datasheet-Url");
|
||||
|
||||
Reference in New Issue
Block a user