# Error Reporting

When an **eVision** function fails, it throws an exception that contains an error code and a description.

* **eVision** code throws exceptions of type [`EException`](../../doxygen_cpp/classeVision_1_1EException.html) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1EException.html) [<sub>Python</sub>](../../doxygen_python/classeVision_1_1EException.html).
* To catch a potential exception, include the function call in a try-catch block.

### C++

```cpp
#include <eVision/Easy/EImageC24.h>
```

```cpp
using namespace eVision;
try
{
  // Image constructor
  EImageC24 srcImage;
  // ...
  // Retrieve the pixel value at coordinates (56, 73)
  EC24 value = srcImage.GetPixel(56, 730);
}
catch (EException exc)
{
  // Retrieve the exception description
  std::string error = exc.What();
}
```

### C#

```cs
using eVision;
```

```cs
try
{
  // Image constructor
  EImageC24 srcImage = new EImageC24();
  // ...
  // Retrieve the pixel value at coordinates (56, 73)
  EC24 value = srcImage.GetPixel(56, 73);
}
catch (EException exc)
{
  // Retrieve the exception description
  string error = exc.What();
}
```

### Python

```py
import eVision
try:
    # Image constructor
    src_image = eVision.EImageC24()
    # ...
    # Retrieve the pixel value at coordinates (56, 73)
    value = src_image.GetPixel(56, 73)
except eVision.EException as e:
    # Retrieve the exception description
    error = str(e)
```

#### SEE ALSO
[`EException::GetError`](../../doxygen_cpp/classeVision_1_1EException.html#ab69fec50b974653002c4e39b39033490) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1EException.html#addcf0a67b6063e5f5fff158a48ebef5b) and [`EException::What`](../../doxygen_cpp/classeVision_1_1EException.html#a9a1c60dbc7c388b95eee403c5301103c) [<sub>.NET</sub>](../../doxygen_cs/classeVision_1_1EException.html#a8c75f62b6a63562d20a09cc7792c0aa9).
