{
  "id": 18229148,
  "title": "supabase-js try/catch Doesn't Catch Errors: Check { error }",
  "url": "https://urgent.news/2026/11/05/supabase-js-try-catch-doesnt-catch-errors-check-error",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-05T02:18:47.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/cometakaito/supabase-js-trycatch-doesnt-catch-errors-check-error--3f98"
  },
  "original_language": "en",
  "account": "The supabase-js query methods did not handle network or PostgREST failures properly. The contract-template resolver would not distinguish between a transient read failure and a lack of published rows, which could freeze an outdated version that the customer had not agreed to. To fix this, the affected code was refactored into a dedicated function called readCurrentRow, which explicitly checked for errors and returned a tuple containing the row data and a failed flag. The getContractMeta function was updated to branch on this failed flag, allowing it to return null and freeze no version when the read itself failed. This ensures that only stable, agreed-upon versions are used in the signing flow, preventing auto-renewal clauses from being applied without proper contractual basis.",
  "summary": "Conclusion supabase-js query methods never throw on network or PostgREST failure. The contract template's current-version resolver branched only on whether data was present, without ever looking at the error that came back alongside it. That meant a transient read failure couldn't be told apart from \"no row has been published yet\" — and when that return value fed a version-freeze decision, it…",
  "key_points": [
    "Supabase-js query methods failed to handle network or PostgREST errors.",
    "Contract-template resolver couldn't distinguish transient read failures from lack of published rows.",
    "Refactored code into readCurrentRow function to check errors and return row data tuple."
  ],
  "editors_take": "Refactoring the error handling logic prevents transient network failures from accidentally freezing outdated contract versions, ensuring that auto-renewal clauses are only applied when a stable data read is confirmed.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}