{"record":{"id":"23264412596ec836","repo":"cube-js/cube","slug":"result-error","errorCode":null,"errorMessage":"${result.error}","messagePattern":"\\$\\{result\\.error\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cubejs-query-orchestrator/src/orchestrator/QueryQueue.ts","lineNumber":429,"sourceCode":"      }\n    });\n\n    return { promise, dispose };\n  }\n\n  /**\n   * @throw {Error}\n   */\n  protected parseResult(result: any): any {\n    if (!result) {\n      return;\n    }\n    if (result instanceof QueryStream) {\n      // eslint-disable-next-line consistent-return\n      return result;\n    }\n    if (result.error) {\n      throw new Error(result.error); // TODO\n    } else {\n      // eslint-disable-next-line consistent-return\n      return result.result;\n    }\n  }\n\n  protected reconcileAgain: boolean = false;\n\n  protected reconcilePromise: Promise<void> | null = null;\n\n  /**\n   * Run query queue reconciliation flow by calling internal `reconcileQueueImpl`\n   * method. Returns promise which will be resolved with the reconciliation\n   * result.\n   */\n  public async reconcileQueue(): Promise<void> {\n    if (!this.reconcilePromise) {\n      this.reconcileAgain = false;","sourceCodeStart":411,"sourceCodeEnd":447,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-query-orchestrator/src/orchestrator/QueryQueue.ts#L411-L447","documentation":"parseResult unwraps the raw result object returned from the query handler; when the result carries an `error` property it re-throws it as a plain Error. This is the queue's generic pass-through for any driver/execution failure, so the message is whatever the underlying system reported (the TODO comment notes this is a raw propagation).","triggerScenarios":"Any queued query whose execution result contains { error: ... } — driver failures, Cube Store errors, SQL errors surfaced through processQuerySkipQueue and then parseResult via executeInQueue.","commonSituations":"Bad SQL generated by a misconfigured schema; Cube Store returning an execution error; driver connection failures during a queued query.","solutions":["Read result.error in the message to find the root cause and fix the underlying query/driver issue","Enable request logging (requestContext / logger) to capture the original query that failed","Wrap executeInQueue calls and branch on the error message for retryable vs permanent failures"],"exampleFix":"// before\nconst result = await queue.executeInQueue('query', key, query, 0, options);\n// after\nlet result;\ntry {\n  result = await queue.executeInQueue('query', key, query, 0, options);\n} catch (e) {\n  console.error('Queued query failed:', e.message);\n  throw e;\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { return await queue.executeInQueue(handler, key, query, priority, opts); } catch (e) { logger.error({ queryKey: key, error: e.message }); throw e; }","preventionTips":["Log the query alongside the error to identify the failing SQL","Fix the root driver/SQL error surfaced in the message","Test schemas so generated SQL is valid before production"],"tags":["query-execution","error-propagation","query-queue"],"backgroundTag":"query-execution-failed","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}