{"record":{"id":"50b9063f5bb284a2","repo":"discourse/discourse","slug":"blocks-unknown-debug-callback-key-key-val","errorCode":null,"errorMessage":"[Blocks] Unknown debug callback key: \"${key}\". Valid keys are: ${validKeys}.","messagePattern":"\\[Blocks\\] Unknown debug callback key: \"(.+?)\"\\. Valid keys are: (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"frontend/discourse/app/lib/blocks/-internals/debug-hooks.ts","lineNumber":100,"sourceCode":"   * @param key - The callback key (use DEBUG_CALLBACK constants).\n   * @returns The callback function, or null/undefined if not set.\n   */\n  getCallback(key: string): DebugCallback | null | undefined {\n    return this.#callbacks.get(key);\n  }\n\n  /**\n   * Sets a debug callback in the registry.\n   * Used by dev-tools to register debug hooks.\n   *\n   * @param key - The callback key (use DEBUG_CALLBACK constants).\n   * @param value - The callback function, or null to clear.\n   * @throws If the key is not a valid callback key.\n   */\n  setCallback(key: string, value: DebugCallback | null): void {\n    if (!this.#callbacks.has(key)) {\n      const validKeys = Object.values(DEBUG_CALLBACK).join(\", \");\n      throw new Error(\n        `[Blocks] Unknown debug callback key: \"${key}\". Valid keys are: ${validKeys}.`\n      );\n    }\n    this.#callbacks.set(key, value);\n  }\n\n  /**\n   * Returns whether console logging is enabled.\n   * Convenience getter that invokes the blockLogging callback.\n   *\n   * @returns True if logging is enabled.\n   */\n  get isBlockLoggingEnabled(): boolean {\n    return (\n      (this.#callbacks.get(DEBUG_CALLBACK.BLOCK_LOGGING)?.() as\n        | boolean\n        | undefined) ?? false\n    );","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/discourse/discourse/blob/1b2d7253e854205d2c95c80b2c6a1cdd42e45059/frontend/discourse/app/lib/blocks/-internals/debug-hooks.ts#L82-L118","documentation":"Error \"[Blocks] Unknown debug callback key: \"${key}\". Valid keys are: ${validKeys}.\" thrown in discourse/discourse.","triggerScenarios":"Thrown at frontend/discourse/app/lib/blocks/-internals/debug-hooks.ts:100 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1b2d7253e854205d2c95c80b2c6a1cdd42e45059","analyzedAt":"2026-08-26T03:11:08.302Z","schemaVersion":2},"datasetVersion":"2026-08-26T07:17:17.940Z"}