List Icon
Archive de la liste de diffusion

La liste de diffusion est fermée depuis juillet 2022, mais sert toujours d'archive d'informations sur QF-Test.
Cependant, si vous souhaitez rester informé des nouveautés concernant QF-Test, vous pouvez simplement vous abonner à la newsletter :
abonner à la newsletter 


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[QF-Test] Exception thrown in a procedure is not catched properly in the calling Jython script


  • Subject: [QF-Test] Exception thrown in a procedure is not catched properly in the calling Jython script
  • From: Bernhard Schmitt <bernhard.schmitt@?.de>
  • Date: Thu, 19 Jan 2017 14:31:51 +0000

Hello,

 

I have the following jython server script:

 

try:

   rc.callProcedure("first")

except UserException, e :

   errMessage = str(sys.exc_info()[0])

   print "debug *" + errMessage + "*"

 

The procedure „first“ just throws an exception:

--Throw UserException „Test“

 

èThe exception in the procedure is logged in the run log as exception. The debug message is „debug *<type 'de.qfs.apps.qftest.shared.exceptions.UserException'>*

 

When I use QF-Test constructs to catche the exception like this:

--Try

----Call procedure: first()

----Catch: UserException

---------Jython Server Script (print rc.getCaughtException().getMessage())

 

èThe exeption is not logged as exception in the run log. It is caught properly and the exception message („Test“) is printed well.

 

 

So my question is: How can I catch a exception thrown in a procedure properly in the calling jython script?

 

 

BR

 

Bernhard

 

 

 

 

========================================================================

Bernhard Schmitt

Consultant Softwaretest

E-Mail: bernhard.schmitt@?.de

------------------------------------------------------------------------

imbus Rhein-Main GmbH, Kirschgartenstraße 15, 65719 Hofheim, DEUTSCHLAND

Tel. +49 6192 92192-0, Fax +49 6192 92192-50

info@?.de http://www.imbus.de

 

Geschäftsführer: Frank Schmeißner, Tilo Linz, Thomas Roßner

Sitz der Gesellschaft: Hofheim

Registergericht: Frankfurt am Main, HRB 52155

========================================================================