3.6.12. NoConnectionsHook Previous topic Parent topic Child topic Next topic

You can run this hook whenever Radiator fails connect to any SQL server. The default is to log the failure. The hook is called with 1 argument: $object. $object is the SqlDb object that was trying to connect.
In the following example the default hook is replaced with a hook that logs a very short message.
NoConnectionsHook sub { \
  my $self = $_[0]; \
  $self->log($main::LOG_ERR, "Could not connect to any SQL database"); }