Errors
All applications can return/throw errors. The CIDL gives a specific place where you can define these errors.
tip
You can define any number of methods required for your use case.
Definition
errors
is an array of objects where each object is an error
errors:
- id: InvalidUserName
msg: The provided username is not valid
- id: WarehouseIsClose
msg: The warehouse cannot transact because
Keyword | Type | Optionality | Description |
---|---|---|---|
errors | ErrorsBody | Optional |
Errors Body
Keyword | Type | Optionality | Description |
---|---|---|---|
id | string | Required | Must comply with the targeted programming language |
msg | string | Required |
Web-based documentation
The errors
object can be visualized in the CIDL web-based doc. The documentation is automatically generated from our
vscode-codigo extension.
Next steps
You can follow our guides to start implementing use cases step by step or check our examples here
Join the Código community 💚
Código is a growing community of developers. Join us on Discord and GitHub