ASN1C C# Runtime Library
7.7
|
Public Member Functions | |
System.Exception | HandleException (Asn1Exception e, Asn1BerDecodeBuffer buffer) |
Asn1BerExceptionHandler defines the interface users implement if they want to be notified of errors durnig decoding and have the opportunity to prevent an exception from being thrown. /p>
System.Exception HandleException | ( | Asn1Exception | e, |
Asn1BerDecodeBuffer | buffer | ||
) |
This method is invoked by generated code before throwing certain exceptions.
If the method returns an exception, that exception will be thrown. Otherwise, if null is returned, the exception will not be thrown. /p> It is always safe to simply return the received exception, e. When returning null, the function is responsible for having performed the required corrective action in order to allow the calling code to resume decoding. The right corrective action will depend on the error condition, as described below. p> ul> li> Asn1InvalidEnumException
Asn1MissingRequiredException: No corrective action is required. Simply return null to ignore the exception. /li> li> Asn1InvalidChoiceOptionException Asn1NotInSetException
Asn1SeqOrderException
Asn1SetDuplicateException
Asn1UnexpectedElementException: If returning null, you must consume the current TLV from the input. /li> /ul>
e | The exception the caller wishes to throw, indicating what error occurred. |
buffer | The decode buffer. |
Referenced by Asn1BerDecodeBuffer.HandleException().