Skip to main content

Documentation Index

Fetch the complete documentation index at: https://hypha-docs.plinqx.app/llms.txt

Use this file to discover all available pages before exploring further.

TRY and THROW nodes provide error handling capabilities, allowing you to catch errors and throw custom errors in flows.

TRY Node

The TRY node implements try-catch-finally error handling:
  • Try Block: Execute nodes that may fail
  • Catch Block: Handle errors from try block
  • Finally Block: Always execute (cleanup, logging)

How TRY Works

1

Execute Try Block

TRY node executes the try block subgraph.
2

Handle Errors

If try block fails, catch block executes.
3

Execute Finally

Finally block always executes (if configured).
4

Continue Flow

Flow continues after TRY node completes.

Configuration

Try Block

Define nodes to execute in try block:
  • Subgraph: Nodes that may throw errors
  • Error Handling: Errors caught automatically
  • Error Access: Access error details in catch block

Catch Block

Handle errors from try block:
  • Error Access: Access error details
  • Error Handling: Log, transform, or recover from errors
  • Flow Continuation: Decide whether to continue or fail

Finally Block

Always execute (optional):
  • Cleanup: Cleanup operations
  • Logging: Log execution details
  • Resource Release: Release resources

Error Details

Access error details in catch block:
{{try_node.error.code}}
{{try_node.error.message}}
{{try_node.error.details}}

THROW Node

The THROW node throws custom errors:
  • Error Code: Custom error code
  • Error Message: Descriptive error message
  • Error Details: Additional error context

Configuration

Error Definition

Define error to throw:
  • Code: Error code identifier
  • Message: Human-readable error message
  • Details: Additional error context (optional)

Use Cases

Error Recovery

Use TRY to recover from errors:
TRY
├── Try: Call external API
└── Catch: Use fallback data

Error Validation

Validate data and throw on invalid:
VALIDATE: Check data
THROW: If validation fails

Error Logging

Log errors before rethrowing:
TRY
├── Try: Execute operation
└── Catch: Log error, then THROW

Best Practices

Specific Errors

Throw specific error codes for different scenarios

Error Messages

Provide clear, actionable error messages

Error Context

Include relevant context in error details

Error Handling

Always handle errors appropriately

Next Steps

LOG Node

Log errors and execution details

VALIDATE Node

Validate data before operations