{"record":{"id":"2f4fe4d45b4f3e58","repo":"santifer/career-ops","slug":"senjob-invalid-url-url","errorCode":null,"errorMessage":"senjob: invalid URL: ${url}","messagePattern":"senjob: invalid URL: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"providers/senjob.mjs","lineNumber":77,"sourceCode":"const POSTING_ANCHOR_RE =\n  /<a\\s[^>]*href=\"https:\\/\\/senjob\\.com\\/jobseekers\\/[^\"]*?_e_\\d+\\.html\"[^>]*>([\\s\\S]*?)<\\/a>/i;\n\n/** The machine-readable publication date, hidden next to its localized form. */\nconst HIDDEN_ISO_DATE_RE = /display:\\s*none;?\\s*\"?>\\s*(\\d{4}-\\d{2}-\\d{2})\\s*</i;\n\n/** @param {any} ctx @param {number} ms */\nfunction sleep(ctx, ms) {\n  if (typeof ctx?.sleep === 'function') return ctx.sleep(ms);\n  return new Promise((r) => setTimeout(r, ms));\n}\n\n/** @param {string} url */\nfunction assertSenjobUrl(url) {\n  let parsed;\n  try {\n    parsed = new URL(url);\n  } catch {\n    throw new Error(`senjob: invalid URL: ${url}`);\n  }\n  if (parsed.protocol !== 'https:') throw new Error(`senjob: URL must use HTTPS: ${url}`);\n  if (parsed.hostname !== TRUSTED_HOST) {\n    throw new Error(`senjob: untrusted hostname \"${parsed.hostname}\" — must be ${TRUSTED_HOST}`);\n  }\n  return url;\n}\n\n/**\n * Collapse a markup fragment to its visible text.\n * Comments are stripped FIRST: the anchor bodies carry `<!-- d ico postulez -->`\n * between the title and a spacer image, and a naive tag strip would leave the\n * comment body sitting inside the title.\n * @param {string} fragment\n * @returns {string}\n */\nexport function visibleText(fragment) {\n  return decodeEntities(","sourceCodeStart":59,"sourceCodeEnd":95,"githubUrl":"https://github.com/santifer/career-ops/blob/aac998c7ed7248ea853b720ceeb1fdbeb322fc5d/providers/senjob.mjs#L59-L95","documentation":"The senjob provider validates URLs via assertSenjobUrl. If the URL string cannot be parsed by the URL constructor, it throws this error before any request is made. This keeps malformed targets from reaching the fetch layer.","triggerScenarios":"Passing a string that fails new URL() to the senjob provider — missing scheme ('senjob.de/...'), whitespace/control characters, or an undefined/empty value where a URL is expected.","commonSituations":"Config entries missing the https:// prefix, URL assembly from parts where a segment was empty, or truncated values from env/config parsing.","solutions":["Make the URL absolute and well-formed (e.g. https://www.senjob.de/...).","Log the exact value at the call site and fix the producer of the malformed string.","Prepend the scheme when absent before calling the provider."],"exampleFix":"// before\nconst url = 'senjob.de/jobs';\n// after\nconst url = 'https://www.senjob.de/jobs';","handlingStrategy":"validation","validationCode":"const isParseable = (u) => { try { new URL(u); return true; } catch { return false; } };\nif (!isParseable(entry.url)) console.warn(`senjob entry URL malformed: ${entry.url}`);","typeGuard":"const isUrl = (u) => { try { new URL(u); return true; } catch { return false; } };","tryCatchPattern":"try { await provider.fetch(entry, ctx); } catch (e) { if (e.message.startsWith('senjob: invalid URL')) { console.error(`Malformed senjob URL: ${entry.url}`); return null; } throw e; }","preventionTips":["Ensure config URLs are absolute with a scheme.","Validate URLs at config load time.","Avoid assembling URLs from possibly-empty parts."],"tags":["url-validation","url-parse","config"],"backgroundTag":"invalid-url-format","analyzedSha":"aac998c7ed7248ea853b720ceeb1fdbeb322fc5d","analyzedAt":"2026-09-16T06:35:29.214Z","contentChangedAt":"2026-09-16T06:35:29.214Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}