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;
    }
}