# try-catch {#try-catch}

**Parent topic:**[Programming Statements](../../Programming/ProgrammingStatements/programming_statements.md)

## Syntax {#syntax}

```
try{ 
    statements 
} 
catch(ex){ 
    statements 
}
```

## Details {#details}

If an exception occurs during the execution of the `try` clause, the error message is stored in the variable ex, and the `catch` clause is executed.

If after executing the `try` clause, no exception occurs, then the `catch` clause is skipped.

## Examples {#examples}

```
1/`7
// output: Arguments for div method can not be string.

try {1/`7} catch(ex){print "oops, please make sure they are all numbers"};
// output: oops, please make sure they are all numbers

ex;
// output: "SYSTEM_Operator" : "Arguments for div method can not be string."
```

