Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Raising Error from ERROR() to ON ERROR Error Handler
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01684274
Message ID:
01684284
Views:
64
Martina and Dragan -

Thank you both for your responses!

Martina - Duh! LOL Gotcha, and that does seem like it would work. Will give it a try! Thanks for the clarification.

Hope everyone has a great day!
________________
_____/ Regards,
____/ al



o---------------------------------------------------
Hi Alex,

The code don't restore ON ERROR but calls ERROR routine.

MartinaJ

>Hello Martina,
>
>Thank you for the reply. I'm not sure I understand... The code you are showing captures the current ON ERROR setting, and then restores it (assuming there was an ON ERROR setting). I understand that but what I'm trying to do is: Within the PROCEDURE Error have code that will do some processing (e.g., logging specific to what that object does), then somehow "bubble up" the error so the ON ERROR set at application launch will process it and do its usual logging of errors in the application-wide error table, and handle any automated recovery.
>
>Basically I want the equivalent of the TRY/CATCH's THROW in the ERROR event (without using TRY/CATCH). That's why I was thinking using the ERROR command in the ERROR() method, but that doesn't work.
>
>Sorry if I'm not seeing what you are trying to tell me.
>________________
>_____/ Regards,
>____/ al
>
>
>
>o---------------------------------------------------
>
>Hi,
>
>
>   PROCEDURE Error
>      *
>      * xxxx::Error
>      *
>      LOCAL m.lcOnE
>      m.lcOnE=ON("ERROR")
>      IF !EMPTY(m.lcOnE)
>         &lcOnE.
>      ENDIF
>      
>   ENDPROC
>
>
>MartinaJ
>
>>Hi all -
>>
>>I have a situation where I'd like to have an object's .ERROR() process an error that occurs in the object, then "raise" or "throw" the error such that the global error handle (i.e., what the app sets up using ON ERROR at launch) will then be able to do its thing as well. I was thinking I could use the ERROR nErrorNumber or cMessageText2 command in .ERROR(), but that is treating like an error (duh!) and as it's in .ERROR() you get the regular VFP Cancel / Suspend / Ignore dialog.
>>
>>[Note: Use of TRY/CATCH is not an option in the scenario I'm dealing with.]
>>
>>Any way to do this?
>>
>>TIA.
>>________________
>>_____/ Regards,
>>____/ al
________________
_____/ Regards,
____/ al

___________________________________________
www.jcn-associates.com
Visual FoxPro Database Application Development and IT Project Management
Previous
Reply
Map
View

Click here to load this message in the networking platform