Exception Management Code Snippet¶
This code snippet shows how to manage eVision exceptions.
C++¶
#include <eVision/Easy/EImageC24.h>
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();
}
See also
C#¶
using eVision;
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();
}
See also
Python¶
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