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.
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.