Commit 8af4f838 authored by metzlerd's avatar metzlerd
Browse files

Fixing error message reporting in Forena.

parent f953e0cd
...@@ -246,7 +246,12 @@ class FrxDataSource{ ...@@ -246,7 +246,12 @@ class FrxDataSource{
} }
public function error($msg='', $log='') { public function error($msg='', $log='') {
FrxReportGenerator::instance()->app->error($msg, $log); if ($msg) {
drupal_set_message(check_markup($msg), 'error');
}
if ($log) {
watchdog('forena', $log, NULL, WATCHDOG_ERROR);
}
} }
public function parseXMLFile($contents) { public function parseXMLFile($contents) {
......
...@@ -227,11 +227,11 @@ class FrxOracle extends FrxDataSource { ...@@ -227,11 +227,11 @@ class FrxOracle extends FrxDataSource {
$e = oci_error($stmt); // For oci_execute errors pass the statement handle $e = oci_error($stmt); // For oci_execute errors pass the statement handle
//drupal_set_message(e_display_array($e)); //drupal_set_message(e_display_array($e));
if ($e['code'] != '1403') { if ($e['code'] != '1403') {
$msg .= htmlentities($e['message']); $msg = htmlentities($e['message']);
$msg .= "\n<pre>\n"; $msg .= "\n<pre>\n";
$msg .= htmlentities($e['sqltext']); $msg .= htmlentities($e['sqltext']);
$msg .= "\n</pre>\n"; $msg .= "\n</pre>\n";
ora_error('', $msg); $this->error('', $msg);
} }
} }
} }
...@@ -241,7 +241,7 @@ class FrxOracle extends FrxDataSource { ...@@ -241,7 +241,7 @@ class FrxOracle extends FrxDataSource {
$msg .= htmlentities($e['sqltext']); $msg .= htmlentities($e['sqltext']);
//printf("\n%".($e['offset']+1)."s", "^"); //printf("\n%".($e['offset']+1)."s", "^");
$msg .= "\n</pre>\n"; $msg .= "\n</pre>\n";
ora_error('Database error, see logs for info', $msg); $this->error('Database error, see logs for info', $msg);
} }
// Retrieve any clob data. // Retrieve any clob data.
......
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