You are viewing limited content. For full access, please sign in.

Question

Question

How do I use LaserficheErrorObject?

SDK
asked on January 9, 2014

It's an abstract class, which I'm not familiar with. A code sample on how to use it would be most welcome.

 

0 0

Answer

SELECTED ANSWER
replied on January 10, 2014

RA reports most failures by throwing an instance of LaserficheRepositoryException.  LaserficheErrorObject is used to indicate errors in a few particular cases where either 1) RA wants to tell you about multiple problems with your fields or 2) a long-running (i.e. asynchronous) operation failed.  In either case you can access the members that are defined in the LaserficheErrorObject base class (if that's what you mean by "getting to that object itself").  That the class is abstract just means that you will be dealing with a subclass of one of the types Ed lists.

1 0

Replies

replied on January 9, 2014

Its okay that its abstract, you shouldn't need to create it, RA will create two versions of it. LongOperationError and BadFieldValue.

 

The main place I've ever used it is the BadFieldValue case. You can call 'GetBadFieldValues' on your EntryInfo if saving fields fails and figure out which fields failed to update and why.

 

EntryInfo entry = ...;
// Set Some Fields wrong
// save

foreach(BadFieldValue value in entry.GetBadFieldValues())
{
    // Process the error
    string field = value.ObjectName;
    string error = value.Message;
    int errorCode = value.ErrorCode;
}

 

1 0
replied on January 10, 2014

Thanks. Can you confirm I can't get to that object itself? I was wanting to use the ErrorCode property. I had assumed this object was created each time there was an Lf error, but maybe not.

0 0
SELECTED ANSWER
replied on January 10, 2014

RA reports most failures by throwing an instance of LaserficheRepositoryException.  LaserficheErrorObject is used to indicate errors in a few particular cases where either 1) RA wants to tell you about multiple problems with your fields or 2) a long-running (i.e. asynchronous) operation failed.  In either case you can access the members that are defined in the LaserficheErrorObject base class (if that's what you mean by "getting to that object itself").  That the class is abstract just means that you will be dealing with a subclass of one of the types Ed lists.

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.