Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can the global error handler be called via TRY-CATCH
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01235566
Message ID:
01235923
Vues:
18
Hi Rick

Thanks for your response. I have modified your code as below, I guess THROW may be the right thing to do for catching the un-anticipated errors.
clear
ON ERROR do ErrorHandler

TRY 
* EVALUATE("Garbage")
 invalid command

CATCH TO loException
    ? "------"
    ? "Exception caught"
    IF loException.errorno = 12
        ? "handled locally"
    else
        THROW    && Rethrow original exception
    endif

        *** Or Fail again - 'outside' error handler fires
	*EVALUATE("More Garbage")
ENDTRY

FUNCTION ErrorHandler
? "--------"
? Message()
? "---"
? Message(1)
WAIT WINDOW "Error Handler called"
RETURN
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform