Help with error trapping and raising

T

ThomasAJ

Any help appreciated as very hard to test because error occurs infrequently.

The error received by the CALLING routine of the procedure below is:
"...Cannot get connection, pool error Timout..."
which occurs after ONLY 1 retry (I know because I 'Call prcErrorsLog' on
every retry to record the retry number); when I want it to retry 10 times.

The errorhandler 'PennyTelAPIServiceErrorHandler ' seems to be called and
raises the error back up the stack to the top calling program.

Public Sub wsm_sendSMS(ByVal str_id As String, ByVal str_password As String,
ByVal lng_type As Long, ByVal str_to As String, ByVal str_message As String,
ByVal dtm_date As Date)

Dim intCountLoop As Integer

'Error Trap
On Error GoTo wsm_sendSMSTrap

RetrySendSMS:

sc_PennyTelAPIService.sendSMS str_id, str_password, lng_type, str_to,
str_message, dtm_date

Exit Sub

wsm_sendSMSTrap:

'Retry sending SMS 10 times.
If intCountLoop < 10 Then
DelaySeconds (1.5)
intCountLoop = intCountLoop + 1
' Record retries to see how often it is retried.
Call prcErrorsLog("Retry = " & intCountLoop & " 'wsm_sendSMS'")
GoTo RetrySendSMS
End If

PennyTelAPIServiceErrorHandler "wsm_sendSMS"

End Sub

Private Sub PennyTelAPIServiceErrorHandler(str_Function As String)
'*****************************************************************
'This subroutine is the class error handler. It can be called from any
class subroutine or function
'when that subroutine or function encounters an error. Then, it will
raise the error along with the
'name of the calling subroutine or function.
'*****************************************************************

'SOAP Error
If sc_PennyTelAPIService.FaultCode <> "" Then
Err.Raise vbObjectError, str_Function,
sc_PennyTelAPIService.FaultString
'Non SOAP Error
Else
Err.Raise Err.Number, str_Function, Err.Description
End If

End Sub
 
B

BruceM via AccessMonster.com

I'm having trouble sorting out what you are trying to do, but I notice that
in the function call you do not quite use the name of the function, which
seems to be "wsm_sendSMS", but which you call as just "sendSMS":

sc_PennyTelAPIService.sendSMS str_id, str_password, lng_type, str_to,
str_message, dtm_date

I would have expected the function argument to be in parentheses rather than
following a dot, but again I am not really following this, and it may well be
correct the way you are doing it. Does the code compile?

The string "pool error" does not appear in a search of microsoft newsgroups
except for your post. I searched a bit elsewhere, and it seems it is not an
Access error message, in which case I suppose the error could have taken
precedence over the Access procedures, or something like that.
 
T

ThomasAJ

Thanks BruceM - see definition below of sc_PennyTelAPIService

Private sc_PennyTelAPIService As SoapClient30
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top