Context Protocol Docs
Start building
  • PROTOCOL OVERVIEW
    • βœ–οΈAbout Context Protocol
    • πŸ‘ΎWhy Context Protocol?
      • Verified AI-Ready Domains (VARD)
      • Training AI with verified data
      • SaaS Solution
    • πŸ€–Technology behind Context
    • πŸ“ˆ$TEX Token
      • Multi-chain token
      • Token Utility
      • Governance
      • Allocation
    • 🧐Use Cases and Applications
      • πŸ“’Telegram bot for updates
      • πŸ”΅Basenames integration
      • 🌎dWeb: Descentralized Website
      • πŸ“ŒDecentralized Link3
  • DEVELOPERS
    • πŸ‘¨β€πŸ’»Why build on Context
    • πŸ—οΈTypescript SDK
      • Initialization
      • Working with Domains
      • Managing Documents
      • Creating Templates
      • Assets
      • Error Handling
    • πŸ“‘Example Workflow
    • ✨Create your first Domain
  • COMMUNITY
    • πŸͺ‚Community Program
    • πŸ«‚Social Media
  • RESOURCES
    • πŸ›ŸSupport
    • πŸ–₯️WebApp
Powered by GitBook
On this page

Was this helpful?

  1. DEVELOPERS
  2. πŸ—οΈTypescript SDK

Error Handling

When calling a function, you can check if an error occurred by checking the error property in the returned object:

const document = await ctx.document("document_path");
if(document.success === false){
  console.error(document.error.error); // Error message
  console.error(document.error.message); // Detailed error message
  console.error(document.error.statusCode); // HTTP status code
}
PreviousAssetsNextExample Workflow

Last updated 10 months ago

Was this helpful?