Jump to content

Exceptions

From Resco's Wiki
Revision as of 06:27, 19 October 2020 by Jzambor (talk | contribs)
Warning Work in progress! We are in the process of updating the information on this page. Subject to change.

This article is designed for technical support providers responsible for helping users of Resco mobile apps who are in charge of analyzing log files and who want to understand better some of the exceptions included in the logs.

What is an exception?

An exception is a programming construct usually describing an error. Unlike simple errors which are represented by a string, exceptions bear more information:

  • The exception name often gives semantic information about the kind of problem encountered. E.g., WebException refers to a problem in web communication.
  • The message is the string describing the problem.
  • The StackTrace (also known as the call stack) is the information for the programmer showing a sequence of calls that lead to the problem.
  • InnerException (if any) refers to a chained (wrapped) exception.

Here are some of the common exceptions you may encounter:

  • Exception - general exception, no additional information available
  • SqliteException refers to a database problem (SQLite is the database engine used by Resco mobile apps)
  • MobileCrm.Data.Google.UnauthorizedException refers to an authorization problem, probably related to some Google service
  • WebException and WebRequestException refer to a web communication problem.
  • HttpException refers to an HTTP communication problem (Resco mobile apps use the HTTP protocol to communicate with various servers)
  • Java.IO.IOException: Low-level Android exception related to input/output operation. Usually wrapped into a more general exception.
  • SyncDownloadException reports sync downloader problem.

Some exceptions clearly indicate a programming bug, for example:

  • NullReferenceException - using a null pointer without proper check
  • InvalidOperationException - some operation was attempted without checking the context, argument, etc.
  • ArgumentOutOfRangeException - some parameter was submitted without checking the allowed range

There are many more exceptions thrown either by the operating system (actually .Net) or by Resco Mobile CRM itself. There is no point in learning them. All you need to realize is that the name may give you some hint.

Two important exceptions

These two Resco Mobile CRM exceptions deserve more attention: RescoSoapException and UserAbortException.

RescoSoapException

Resco uses this exception to denote server error response in a format understood by Resco mobile apps. (Actually, an HTTP error 500 containing SOAP error response, that's why the exception name.)

What is specific about this exception is that it contains selected details from the server error response.

These details are listed under <soap> tag, for example

<soap>"error" : "invalid_grant", "error_description" : "Token has been expired or revoked."</soap>

You should read them as

error = invalid_grant
error_description = "Token has been expired or revoked."

UserAbortException

UserAbortException is used by the sync module to denote abort events. Abort can be initiated either by the user or by the operating system (when terminating Resco Mobile CRM because the user switched to another app).

The latter case will generate also crash log entry such as

Application 11.2.3.0 ERROR 2018-11-03 09:31:44.061+01:00
System.Exception: OnAbortBackgroundTask

Exception chaining