{"record":{"id":"5ef92eb70e42bf56","repo":"angular/angular-cli","slug":"null","errorCode":null,"errorMessage":"<null>","messagePattern":"<null>","errorType":"exception","errorClass":"JobDoesNotExistException","httpStatus":null,"severity":"error","filePath":"packages/angular_devkit/architect/src/jobs/dispatcher.ts","lineNumber":56,"sourceCode":" * @param options\n */\nexport function createDispatcher<A extends JsonValue, I extends JsonValue, O extends JsonValue>(\n  options: Partial<Readwrite<JobDescription>> = {},\n): JobDispatcher<A, I, O> {\n  let defaultDelegate: JobName | null = null;\n  const conditionalDelegateList: [(args: JsonValue) => boolean, JobName][] = [];\n\n  const job: JobHandler<JsonValue, JsonValue, JsonValue> = Object.assign(\n    (argument: JsonValue, context: JobHandlerContext) => {\n      const maybeDelegate = conditionalDelegateList.find(([predicate]) => predicate(argument));\n      let delegate: Job<JsonValue, JsonValue, JsonValue>;\n\n      if (maybeDelegate) {\n        delegate = context.scheduler.schedule(maybeDelegate[1], argument);\n      } else if (defaultDelegate) {\n        delegate = context.scheduler.schedule(defaultDelegate, argument);\n      } else {\n        throw new JobDoesNotExistException('<null>');\n      }\n\n      context.inboundBus.subscribe(delegate.inboundBus);\n\n      return delegate.outboundBus;\n    },\n    {\n      jobDescription: options,\n    },\n  );\n\n  return Object.assign(job, {\n    setDefaultJob(name: JobName | null | JobHandler<JsonValue, JsonValue, JsonValue>) {\n      if (isJobHandler(name)) {\n        name = name.jobDescription.name === undefined ? null : name.jobDescription.name;\n      }\n\n      defaultDelegate = name;","sourceCodeStart":38,"sourceCodeEnd":74,"githubUrl":"https://github.com/angular/angular-cli/blob/bb72145f9ab45aee29f523236b3a25cd0813a841/packages/angular_devkit/architect/src/jobs/dispatcher.ts#L38-L74","documentation":"createDispatcher's job handler tries to delegate to a matching job from registered delegate jobs or a defaultDelegate. If neither exists, it throws JobDoesNotExistException('<null>') — meaning no job was registered to dispatch to.","triggerScenarios":"Creating/dispatching a job via createDispatcher (or dispatcher job) when no registered job name matched the incoming argument and no defaultDelegate was provided to the JobRegistry/scheduler setup.","commonSituations":"Forgetting to register the delegate job(s) before dispatching; passing arguments that match no registered job's name/description; constructing a dispatcher without a default fallback in multi-job setups.","solutions":["Register the delegate job(s) with the scheduler/registry before creating the dispatcher","Provide a defaultDelegate job name so unmatched dispatches have a fallback","Check that the dispatch argument/name matches the registered job names exactly (case-sensitive)","Inspect the dispatcher's job registry contents in a debug step to confirm what is registered"],"exampleFix":"// before\nconst dispatcher = createDispatcher(registry, { defaultDelegate: undefined });\n// after\nregistry.register(defaultJob);\nconst dispatcher = createDispatcher(registry, { defaultDelegate: defaultJob.name });","handlingStrategy":"try-catch","validationCode":"const registered = registry.getJobNames ? registry.getJobNames() : [];\nif (!registered.includes(delegateName) && !defaultDelegate) {\n  throw new Error(`No delegate job registered; register ${delegateName} or set defaultDelegate`);\n}","typeGuard":"function hasDelegate(jobs, defaultDelegate) {\n  return (Array.isArray(jobs) && jobs.length > 0) || !!defaultDelegate;\n}","tryCatchPattern":"import { JobDoesNotExistException } from '@angular-devkit/architect';\ntry {\n  const dispatcher = createDispatcher(registry, options);\n} catch (e) {\n  if (e instanceof JobDoesNotExistException) {\n    console.error('Register delegate jobs (or a defaultDelegate) before dispatching');\n  }\n  throw e;\n}","preventionTips":["Register all delegate jobs before creating the dispatcher","Always configure a defaultDelegate when dispatch arguments are dynamic","Unit-test the dispatcher with the exact argument shapes used in production","Keep job names in a single constants module to avoid case mismatches"],"tags":["angular","architect","jobs","dispatcher","job-not-registered"],"backgroundTag":"job-does-not-exist","analyzedSha":"bb72145f9ab45aee29f523236b3a25cd0813a841","analyzedAt":"2026-08-30T02:47:34.745Z","schemaVersion":2},"datasetVersion":"2026-08-30T03:17:51.788Z"}