{"record":{"id":"d235fed023b1d530","repo":"unionlabs/union","slug":"not-implemented","errorCode":null,"errorMessage":"NOT IMPLEMENTED","messagePattern":"NOT IMPLEMENTED","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"app2/src/lib/services/shared/quote-token.ts","lineNumber":58,"sourceCode":"          client.queryContractSmart(fromHex(channel.destination_port_id, \"string\"), {\n            predict_wrapped_token: {\n              path: \"0\",\n              channel: channel.destination_channel_id,\n              token: base_token,\n            },\n          }),\n        catch: error =>\n          new GetQuoteError({ cause: `Failed to predict quote token (Cosmos): ${error}` }),\n      }).pipe(\n        Effect.map(res => res.wrapped_token as Hex),\n        Effect.retry(retryPolicy),\n      )\n\n      return { type: \"NEW_WRAPPED\" as const, quote_token: predictedQuoteToken }\n    }\n\n    if (destinationChain.rpc_type === \"evm\") {\n      throw new Error(\"NOT IMPLEMENTED\")\n\n      // return { type: \"NEW_WRAPPED\" as const, quote_token: predictedQuoteToken }\n    }\n\n    return yield* Effect.fail(\n      new GetQuoteError({ cause: `${destinationChain.rpc_type} not supported` }),\n    )\n  })\n","sourceCodeStart":40,"sourceCodeEnd":67,"githubUrl":"https://github.com/unionlabs/union/blob/031785bb6dc6b957c624e62bc64c184409c97d7b/app2/src/lib/services/shared/quote-token.ts#L40-L67","documentation":"The quote-token prediction service implements only the Cosmos branch (an Effect that predicts a wrapped token). When destinationChain.rpc_type === \"evm\" the function throws a bare Error('NOT IMPLEMENTED') with the real implementation left as a commented-out line below it. Because this throw happens inside Effect.gen, it surfaces as a defect (die), bypassing the typed GetQuoteError channel used for the unsupported-rpc_type case.","triggerScenarios":"Invoking the quote-token prediction flow for a transfer whose destination chain has rpc_type \"evm\" (Cosmos-source transfers predicting a new wrapped token on an EVM destination).","commonSituations":"Enabling an EVM destination chain in app config before SDK support lands; regression tests that iterate all configured chains and hit the stub branch.","solutions":["Pre-filter by destinationChain.rpc_type in the caller/UI so prediction is never requested for EVM destinations; show 'unsupported' instead","If you own this code, replace the bare throw with yield* Effect.fail(new GetQuoteError({ cause: \"evm destination not supported yet\" })) so it fails as a typed error instead of a defect","Implement the EVM branch (predict the wrapped quote token via the EVM gateway contract) and delete the dead commented line"],"exampleFix":"// before\nif (destinationChain.rpc_type === \"evm\") {\n  throw new Error(\"NOT IMPLEMENTED\")\n  // return { type: \"NEW_WRAPPED\" as const, quote_token: predictedQuoteToken }\n}\n\n// after\nif (destinationChain.rpc_type === \"evm\") {\n  return yield* Effect.fail(\n    new GetQuoteError({ cause: \"evm destination not supported yet\" }),\n  )\n}","handlingStrategy":"validation","validationCode":"const isPredictableDestination = (c: { rpc_type: string }) => c.rpc_type !== \"evm\"\n\nif (!isPredictableDestination(destinationChain)) {\n  // skip prediction; show unsupported / use fallback quote token\n}","typeGuard":null,"tryCatchPattern":"// bare throws inside Effect.gen become defects — catch them at the run boundary\nconst result = await Effect.runPromise(program).catch(e => {\n  if (e instanceof Error && e.message === \"NOT IMPLEMENTED\") {\n    return fallbackQuoteToken()\n  }\n  throw e\n})","preventionTips":["Filter destination chains by rpc_type before invoking quote-token prediction","Never throw bare Errors inside Effect.gen — use Effect.fail with a typed error","Add a regression test that iterates all configured rpc_types so stub branches fail loudly in CI"],"tags":["evm","cosmos","not-implemented","effect"],"backgroundTag":null,"analyzedSha":"031785bb6dc6b957c624e62bc64c184409c97d7b","analyzedAt":"2026-08-16T06:24:09.996Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}