>>>>Try
>>>> lnReturn = DoSelect(lcSQL)
>>>>Catch
>>>> AError(laErrors)
>>>>
>>>> If laErrors(1) = 1832
>>>> This.SetError(This.Class + ' SQL ERROR:' + laErrors(2), laErrors(1))
>>>> Endif
>>>>
>>>> lnReturn = -1
>>>>Endtry
>>>>
>>>
>>>The only way is to fix DoSelect procedure to return information about the error.
>>
>>Jim Nelson gave me the answer..
>>
>>He said:
>>
>> Catch to loException
>>
>> loException is an exception object (look it up in help file)
>>
>>
>>So, now my final code looks like this and works EXACTLY like needed.
>>
>>
>>Try
>>
>> lnReturn = DoDefault(lcSelect)
>>
>>Catch to loException
>>
>> This.Seterror(This.Class + '.' + loException.Procedure + ':' + loException.Message, loException.ErrorNo)
>>
>> lnReturn = -1
>>
>>Endtry
>>
>
>Good point about exception - does it catch all the details?
The Exception object that it creates contains TONS of useful data:
Here are the properties on the Exception object:
.BaseClass
.Class
.ClassLibrary
.Comment
.Details
.ErrorNo
.LineContents
.LineNo
.Message
.Name
.Parent
.ParentClass
.Procedure
.StackLevel
.Tag
.UserValue
.