HOW TO

Trap errors using only the number

Last Published: April 25, 2020

Summary

Instructions provided describe how to trap errors using only the number. SOAP error messages always begin with an error number. Although the error message text may be updated, the meaning and the error number always remain the same. The application should search only for error message numbers.

Procedure

Within the try/catch block, verify the error message begins with a certain error number.

For example, to check if the exception ex is error #6001:

VB.NET:

Code:
If ex.Message.StartsWith("6001:") Then
'Put the friendly error message here
End If


C#:

Code:
if (ex.Message.StartsWith("6001:")){
//Put the friendly error message here.
}


Java:

Code:
if (ex.getException().getMessage().startsWith("6001:")){
//Put the friendly error message here.
}


Article ID:000008143

Software:
  • Legacy Products

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic