Hi,
how can I throw an error message in Perl and abort PT compilation?
I have a Perl module that is supposed to create an ODBC connection and I'd like to stop the compilation of the presentation template in case there's a connection error. In addition, I'd like to print a custom error message. Currently I do:
if (!($db = new Win32:
DBC ($ODBCConnectString))) {
iwpt_outout ("
Error connecting to database: " . Win32:
DBC::Error () . "
");
print ("
Error connecting to database: " . Win32:
DBC::Error () . "
");
TeamSite:
Tparser::error ("custom error message");
}
The problem is the code that requires a connection to exist. If the connection does not exist, the PT compilation fails with a "Could not process template" error but it does neither show my custom error message nor my message sent through iwpt_output().
Thanks in advance!
Best regards,
Ronny Rentner