Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Raising Error from ERROR() to ON ERROR Error Handler
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01684274
Message ID:
01684279
Vues:
57
This message has been marked as the solution to the initial question of the thread.
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
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform