Added a bit better error handling. Writing errors to logfile now, if turned on in config.

This commit is contained in:
AndreasK79
2020-08-08 08:47:02 +02:00
parent ddfb3f5958
commit cea2cb3ea8
2 changed files with 15 additions and 6 deletions

View File

@@ -36,7 +36,7 @@ class Qrz extends CI_Controller {
}
} else {
echo "No station_id's with a QRZ API Key found";
log_message('info', "No station_id's with a QRZ API Key found");
log_message('error', "No station_id's with a QRZ API Key found");
}
}
@@ -67,9 +67,12 @@ class Qrz extends CI_Controller {
$result = $this->logbook_model->push_qso_to_qrz($qrz_api_key, $adif);
}
if ($result) {
if ($result['status'] == 'OK') {
$this->markqso($qso['COL_PRIMARY_KEY']);
$i++;
} else {
log_message('error', 'QRZ upload failed for qso: ' .$adif);
log_message('error', 'QRZ upload failed with the following message: ' .$result['message']);
}
}
return $i;