parseError Method

Summary

Creates a ServiceError object from the parameters of a Promisefail callback.

Syntax
TypeScript
JavaScript
parseError = function( 
   jqXHR, 
   statusText, 
   errorThrown 
) 
static parseError( 
   jqXHR: JQueryXHR, 
   statusText: string, 
   errorThrown: string 
): ServiceError; 

Parameters

jqXHR

The calling jQuery object.

statusText

String describing the type of error that occurred.

errorThrown

optional exception object, if one occurred.

Remarks

When a Document Library Service call fails for any reason, the Promise object returned from that method will call its fail handler. The arguments provided to a function registered in the fail handler are the jQuery jqXHR object (a superset of the XML Http Response object), a statusText string, and an errorThrown string.

If the error occurred within the Document Service, all three of these parameters should have values. If the error occurred while parsing or delivering the data (and thus was not the fault of the service), only errorThrown, the third argument, will have a value. If UploadFile/uploadfiledocument service call was aborted using the special abort method, all of the parameters to the fail callback will be null.

These three objects can be passed to ParseError as-is to create a new ServiceError object. ParseError parses the name of the original method call as a string and sets it as MethodName.

See ServiceError or Promises in the Document Library Service for more information.

Requirements

Target Platforms

Help Version 23.0.2024.7.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Document Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.