> For the complete documentation index, see [llms.txt](https://jmdash.gitbook.io/jmdash-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jmdash.gitbook.io/jmdash-docs/jmbasics/syntax101/error-handling.md).

# Error Handling

If you want to know more about **JM-**'s Error Handling, I recommend you to read the page(s) on the [IDoEHD](/jmdash-docs/design-documents/initial-design-of-error-handling-document.md) and the [functions i](/jmdash-docs/jmbasics/syntax101/calling-functions/built-in-functions.md#error-handling-functions)[t introduced](/jmdash-docs/design-documents/initial-design-of-error-handling-document/the-error-tree.md).

For errors' names, check [The Error Tree](/jmdash-docs/design-documents/initial-design-of-error-handling-document/the-error-tree.md)

## Syntax & Examples

{% code lineNumbers="true" %}

```c
// jtry{} Stands for 'JMDash Try'
// Used to check if a statement will return errors
// Syntax (spaced): jtry{ << <possiblyWrongCodeHere> };
jtry{<<
    str myString = MyText; // Code that will trigger errors (missing quotes)
};

// jcatch{} Stands for 'JMDash Catch'
// Used to catch errors that have been "tried" by jtry{}
// Find the error location in the Error Tree (on JMDash Docs)
// Syntax (spaced): jcatch{<errorLocation> >> <possiblyWrongCodeHere>};
jcatch{ SyntaxError/WrongSyntaxOnDataType/WrongSyntaxOnString };

// jcatch{} can also "try" errors itself;
jcatch{ SyntaxError/WrongSyntaxOnDataType/WrongSyntaxOnString >> 
    str myString = MyText; // Code that will trigger errors (missing quotes)
};
```

{% endcode %}

{% code lineNumbers="true" %}

```c
// jthrow{} Stands for 'JMDash Throw'
// Used to throw errors, real simple :))
// Find the error location in the Error Tree (on JMDash Docs)
// Syntax (spaced): jthrow{ >> <errorLocation> };
jthrow{>> SyntaxError/WrongSyntaxOnDataType/WrongSyntaxOnString};
```

{% endcode %}
