Commit 65c53e3c authored by Franco Fichtner's avatar Franco Fichtner

dyndns: r53 should not throw php errors, rather log to syslog

parent a5e7a055
......@@ -542,7 +542,8 @@
$NewIP=$this->_dnsIP;
$NewTTL=$this->_dnsTTL;
/* Include Route 53 Library Class */
/* Include Route 53 Library Class (and util.inc for log_error) */
require_once('util.inc');
require_once('dyndns.r53.class');
/* Set Amazon AWS Credentials for this record */
......
......@@ -532,17 +532,17 @@ class Route53
public function __triggerError($functionname, $error)
{
if($error == false) {
trigger_error(sprintf("Route53::%s(): Encountered an error, but no description given", $functionname), E_USER_WARNING);
log_error(sprintf("Route53::%s(): Encountered an error, but no description given", $functionname));
}
else if(isset($error['curl']) && $error['curl'])
{
trigger_error(sprintf("Route53::%s(): %s %s", $functionname, $error['code'], $error['message']), E_USER_WARNING);
log_error(sprintf("Route53::%s(): %s %s", $functionname, $error['code'], $error['message']));
}
else if(isset($error['Error']))
{
$e = $error['Error'];
$message = sprintf("Route53::%s(): %s - %s: %s\nRequest Id: %s\n", $functionname, $e['Type'], $e['Code'], $e['Message'], $error['RequestId']);
trigger_error($message, E_USER_WARNING);
log_error($message);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment