cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to handle errors properly

rodrigo_alvare1
Dynatrace Pro
Dynatrace Pro

Hello,

Im creating some scripts and would like to know what function use to mark the test as failed due to some conditions.

Im using WriteLog and RaiseError, but Im not sure if there is another function that fits better.

Regards,


Rodrigo

2 REPLIES 2

Steven_Monroe
Inactive

Hey Rodrigo, I believe the function that will suit your need is MarkTransUnavailable. For future reference, have a look at the framework guide I've attached. You can find a lot of useful info in there. At the bottom of the guide there are appendixes which list a plethora of functions that can be leveraged.

yuriy_look
Inactive

Hi Rodrigo and Steve,

MarkTransUnavailable affects how transaction appears in the report, as the name of the function says. RaiseError passes control to the error handler, and thus stops further execution of the script. And WriteLog allows you to put into the log information about the details of the erroneous condition. So all of the mentioned functions have their own place.

Feel free to post further questions should you have any.

Thank you,

Yuriy