Forum Discussion

Fimbultyr's avatar
Fimbultyr
Contributor
8 years ago

Error Handling from aqFileSystem

Hi there,

 

I am quite new to Testautomation with TC and are currently struggling with one thing.

 

In several Python scripts we are copying files with aqFileSystem.CopyFolder().

 

Most of the times this works as expected, but if an error occurs, there is only a message raised in the TC log, not an error.

That is somehow not right, because the testlog will show everything is fine, even an error occurred while copying files.

 

I tried to en capsule the operations with:

try:

Copy stuff

except Exception as e:

Log.Error(str(e))

 

As stated in the TC documentation for error handling in scripts, but the exception is not recognized as it seems.

I guess in aqFileSystem it is already catched and handled as Log.Message()

 

Does somebody know how to switch this message to an error?

The only solution left is checking the file after copy and raise an exception separately, but the script already knows, that something went wrong, so it feels quite redundant.

 

Cheers,

Constantin