Name

dberror — produce a more helpful error page when db connections fail

Synopsis

use Wacs;
dberror(...); 
 

Parameters

parameterdescription
headerWhether to add an HTML preamble or not: n for no, y for yes.
messageThe message the end-user should recieve
errorThe error message returned from the database routines; logged in the web server error log
dbuserThe database user account with which the access was being attempted, from the config file's dbuser entry.
dbhostThe host specification of the database that it was trying to access, from the config file's dbiconnect entry when using perl, and the phpdbconnect entry when using PHP

Summary

The dberror function provides a detailed and hopefully helpful error message when the WACS sub-system cannot connect to the database server. It also logs details of the failure to the web server error log.

Availability

dberror is available in both perl and php. It was introduced in Wacs 0.8.1.