PAC-E006 · runtime-exception

Evaluation throws an exception

high · Errors and robustness

A test evaluation ended with an uncaught exception instead of a return value. The engine treats this as a script failure for that request.

Why it matters

This is the observed counterpart of static findings such as PAC-E005: for at least one of the test URLs the function threw instead of returning. Engines do not retry or use a later branch; the request is handled as if the PAC failed. In Chromium and Firefox that means a direct connection. Windows (WinHTTP) returns an error to the program that asked; in the lab (2026-10-11) programs built on .NET Framework and .NET 8 then went direct without showing an error. If the exception is only thrown for some hosts, the PAC “works” in a quick manual test and fails in production for exactly those hosts.

How to fix

Look at the exception detail and the deciding line; common causes are undefined functions, typos in variable names and calling methods on undefined.

Examples

Bad

function FindProxyForURL(url, host) {
  var parts = host.split(".");
  if (parts[parts.length - 1] == "test" && undefinedList.indexOf(host) >= 0) {
    return "DIRECT";
  }
  return "PROXY proxy.corp.example:8080";
}
Open bad example in checker

Good

var directHosts = ["intranet.test", "wiki.test"];
function FindProxyForURL(url, host) {
  if (directHosts.indexOf(host) >= 0) {
    return "DIRECT";
  }
  return "PROXY proxy.corp.example:8080";
}
Open good example in checker

In the bad example the identifier undefinedList is never declared; hosts under .test throw a ReferenceError.

Engine behaviour

EngineBehaviourSource
winhttpAn exception gives the calling program an error instead of a proxy list. .NET Framework and .NET 8 programs then connected directly without showing an error.lab, verified 2026-10-11

Source: code = read in the engine's source, doc = vendor documentation, lab = observed in a lab run, expert = practitioner knowledge, not yet verified.

Related rules

References

Last updated: