santifer/career-ops · error · Error

rippling: invalid URL

Error message

rippling: invalid URL: ${url}

What it means

The rippling provider validates URLs via assertRipplingApiUrl. If the URL string cannot be parsed by the URL constructor (malformed scheme/host, whitespace, missing protocol in a context that requires it), it throws this error before any network call.

Solutions

  1. Ensure the URL is absolute and well-formed, e.g. https://api.rippling.com/... .
  2. Log the exact url value at the call site; fix whatever produced the malformed string (usually a missing base or empty slug).
  3. Normalize input: prepend https:// when the string lacks a scheme before validation.

Example fix

// before
const url = 'api.rippling.com/jobs?slug=' + slug; // throws
// after
const url = 'https://api.rippling.com/jobs?slug=' + slug;
Defensive patterns

Strategy: validation

Validate before calling

function isParseableUrl(u) { try { new URL(u); return true; } catch { return false; } }
if (!isParseableUrl(candidate)) throw new Error(`skip: malformed URL ${candidate}`);

Type guard

const isUrl = (u) => { try { new URL(u); return typeof u === 'string'; } catch { return false; } };

Try / catch

try { await provider.fetch(entry, ctx); } catch (e) { if (e.message.startsWith('rippling: invalid URL')) { console.error(`Malformed URL for ${entry.name}`); return null; } throw e; }

Prevention

When it happens

Trigger: Passing a non-parseable string to assertRipplingApiUrl — e.g. 'rippling.com/api/jobs' without a scheme, a URL with spaces or invalid characters, or an empty/undefined value coerced into the URL constructor path where it fails.

Common situations: Config or code building the API URL from a slug where a base was omitted, env var interpolation producing an empty or garbage string, or copy-pasting a browser-omitted https:// prefix.

Understand the failure class

Background: "Invalid URL" errors: why new URL(), URI.parse, and reqwest::Url reject your string — missing scheme, whitespace, and bad path format — this error's family across 39 libraries.

Related errors


AI-assisted analysis of santifer/career-ops@aac998c7ed (2026-09-16). Data as JSON: /api/errors/09a0d02758939192. Report an issue: GitHub.

Appendix: source

Thrown at providers/rippling.mjs:54

  if (parsed.protocol !== 'https:') return null;
  if (parsed.hostname !== CAREERS_HOST) return null;
  const segment = parsed.pathname.split('/').filter(Boolean)[0] || '';
  if (!SLUG_RE.test(segment)) return null;
  return segment;
}

/** Build the board API URL for a validated slug. */
function apiUrlForSlug(slug) {
  return `${API_BASE}/${encodeURIComponent(slug)}/jobs`;
}

/** @param {string} url */
function assertRipplingApiUrl(url) {
  let parsed;
  try {
    parsed = new URL(url);
  } catch {
    throw new Error(`rippling: invalid URL: ${url}`);
  }
  if (parsed.protocol !== 'https:') throw new Error(`rippling: URL must use HTTPS: ${url}`);
  if (parsed.hostname !== API_HOST) {
    throw new Error(`rippling: untrusted hostname "${parsed.hostname}" — must be ${API_HOST}`);
  }
  return url;
}

/** @type {Provider} */
export default {
  id: 'rippling',

  detect(entry) {
    const slug = resolveSlug(entry);
    return slug ? { url: apiUrlForSlug(slug) } : null;
  },

  async fetch(entry, ctx) {

View on GitHub (pinned to aac998c7ed)