Product Information > JADE .NET Developer’s Reference > Chapter 7 - Developing Applications in .NET to Use JADE Classes > Exceptions

Exceptions

The JadeSoftware.Joob.Exception namespace contains exception classes, including JOM exceptions that are implemented as subclasses of JoobJomException. These exceptions can be caught in the normal manner, as shown in the following example.

void catchAnException()
{
    JoobContext context = JoobContext.CurrentContext;
    Client c = context.FirstInstance<Client>();

    try
    {
        c.Name = c.Name; // generated 'update outside transaction' exception
    }
    catch (JoobUpdateOutsideTransactionException)
    {
       // Expected exception
    }
    catch (JoobJomException jje)
    {
        int jomErrorError = jje.ErrorCode;
        String jomErrorText = jje.ErrorText;
    }
    catch (JoobException e)
    {
        String errorMessage = e.Message;
    }
}