decolua/9router · error · Error

Unsupported format

Error message

Unsupported format

What it means

ProxyPoolsPage's line parser throws this when a trimmed import line splits into something other than 4 or 5 (URL form handled above the shown region) colon-separated parts — i.e. the line matches no supported proxy notation. It is the final fallthrough of parseProxyLine.

Source

Thrown at src/app/(dashboard)/dashboard/proxy-pools/page.js:478

      };
    }

    const parts = trimmed.split(":");
    if (parts.length === 4) {
      const [host, port, username, password] = parts;
      if (!host || !port || !username || !password) {
        throw new Error("Invalid host:port:user:pass format");
      }

      const proxyUrl = `http://${encodeURIComponent(username)}:${encodeURIComponent(password)}@${host}:${port}`;
      const parsed = new URL(proxyUrl);
      return {
        proxyUrl: parsed.toString(),
        name: `Imported ${host}:${port}`,
      };
    }

    throw new Error("Unsupported format");
  };

  const handleBatchImport = async () => {
    const lines = batchImportText
      .split(/\r?\n/)
      .map((line) => line.trim())
      .filter(Boolean);

    if (lines.length === 0) {
      notify.warning("Please paste at least one proxy line.");
      return;
    }

    const parsedEntries = [];
    const invalidLines = [];

    lines.forEach((line, index) => {
      try {

View on GitHub (pinned to 90b52e06ff)

Solutions

  1. Format each line as host:port:user:pass (or a full proxy URL form the parser accepts)
  2. Convert space/comma-separated proxy lists to colon-separated before importing
  3. Remove blank lines and comment lines from the batch input
  4. Pre-validate lines in the UI and skip invalid ones with a reported error list instead of aborting

Example fix

// before
throw new Error("Unsupported format");
// after
throw new Error(`Unsupported format on line: "${trimmed}" — expected host:port:user:pass or a proxy URL`);
Defensive patterns

Strategy: validation

Validate before calling

// pre-validate accepted notations
const ok = /^[^:\s]+:\d+:[^:]+:[^:]+$/.test(line) || /^https?:\/\//.test(line);
if (!ok) throw new Error(`Unsupported format: "${line}"`);

Try / catch

try {
  const proxy = parseProxyLine(line);
  results.push(proxy);
} catch (err) {
  lineErrors.push(`Line ${i + 1}: ${err.message}`);
  continue;
}

Prevention

When it happens

Trigger: Lines with fewer than 4 segments (`host:port`), more than 5 (`host:port:user:pass:extra`), or non-URL notations like `host port user pass` (spaces not colons).

Common situations: Pasting a bare host:port without credentials; proxy lists using space or comma separators; lines with protocol prefixes plus credentials producing unexpected segment counts; stray whitespace/comments in the batch textarea.

Related errors


AI-assisted analysis of decolua/9router@90b52e06ff (2026-08-30). Data as JSON: /api/errors/db900c66a319cc51. Report an issue: GitHub.