Branch errors
Split an error path by declared error codes, with Other as the fallback.
Type
err.branch Block Error
Folder
basic/errorChannels
Any
Pipe
Input
Scope
Any
Branch errors sits on an error path. Connect its In from a block Error outlet or from Try On error. The canvas lists every error code declared on that upstream block (for Try On error, codes from the Do subgraph, including Throw error).
Each listed code has its own outlet. Other (bottom) receives:
- Listed codes you did not connect
- Codes the schema does not list
- Errors with no code
If Other is not connected, the error throws (same as an unused Error outlet).
Handles
| Handle | Role |
|---|---|
| In (target) | Incoming error path |
Per code (err.branch.code.<CODE>) | That declared code, when the outlet is connected |
Other (err.branch.other) | Everything else, including unwired listed codes |
The next block still sees the error as pipe.error / context error (message, code, data, blockId, blockType).
Use case
- After an API Error outlet:
LOOPBACK_URL_BLOCKEDvsINVALID_SERVER_URLvs Other. - After Try On error:
THROWNvs Other.