diff --git a/html/do.php b/html/do.php index b01ab8d3b..df7396bd7 100644 --- a/html/do.php +++ b/html/do.php @@ -255,7 +255,7 @@ if (isset($_REQUEST['ac'])) } else { alert($e->getMessage()); - error_log($e->getTraceAsString()); + record_log($e->getTraceAsString()); } } } @@ -285,7 +285,7 @@ else catch (Exception $exc) { echo $exc->getMessage(); - error_log($exc->getTraceAsString()); + record_log($exc->getTraceAsString()); } } diff --git a/include/action.common.inc.php b/include/action.common.inc.php index 501a28992..71b46c280 100644 --- a/include/action.common.inc.php +++ b/include/action.common.inc.php @@ -150,6 +150,7 @@ if ($sub_action == "update") $act->get(); $act->fromArray($_POST); $error_id=$e->getCode(); + record_log($e->getTraceAsString()); } } //---------------------------------------------------------------------- @@ -289,6 +290,7 @@ if ($sub_action == "save_action_st2") echo ''; $sub_action="add_action"; $error_id=$e->getCode(); + record_log($e->getTraceAsString()); } } //-------------------------------------------------------------------------------- diff --git a/include/ajax/ajax_account_update.php b/include/ajax/ajax_account_update.php index bc6c3afc1..c18529d2f 100644 --- a/include/ajax/ajax_account_update.php +++ b/include/ajax/ajax_account_update.php @@ -77,6 +77,7 @@ if ($action=="update" &&$acc_delete==0) $message=_("Valeurs invalides, pas de changement")." \n ". $e->getMessage(); $ctl='nok'; + record_log($e->getTraceAsString()); } if (strlen($p_val)!=0&&strlen($p_lib)!=0&&strlen($old_line)!=0) { @@ -108,6 +109,7 @@ if ($action=="update" &&$acc_delete==0) { $message=$e->getMessage(); $ctl='nok'; + record_log($e->getTraceAsString()); } } } diff --git a/include/ajax/ajax_gestion.php b/include/ajax/ajax_gestion.php index f7eae9a46..56ae41f98 100644 --- a/include/ajax/ajax_gestion.php +++ b/include/ajax/ajax_gestion.php @@ -83,6 +83,7 @@ if ($op=='action_save') } catch (Exception $ex) { + record_log($ex->getTraceAsString()); header('Content-type: text/xml; charset=UTF-8'); $dom=new DOMDocument('1.0', 'UTF-8'); $xml_content=$dom->createElement('content', $ex->getMessage()); @@ -115,6 +116,7 @@ if ($op=='action_save') $gestion->save_short(); } catch (Exception $ex) { + record_log($ex->getTraceAsString()); $content=$ex->getMessage(); $status='NOK'; } diff --git a/include/ajax/ajax_ledger.php b/include/ajax/ajax_ledger.php index 2ce5c27bb..dba4bbacc 100644 --- a/include/ajax/ajax_ledger.php +++ b/include/ajax/ajax_ledger.php @@ -156,6 +156,7 @@ case 'rmop': } catch (Exception $e) { + record_log($e->getTraceAsString()); $e->getMessage(); $cn->rollback(); } @@ -201,6 +202,7 @@ case 'de': } catch (Exception $e) { + record_log($e->getTraceAsString()); echo HtmlInput::anchor_close($div); echo '
'; diff --git a/include/class/class_acc_bilan.php b/include/class/class_acc_bilan.php index 86a41bf73..f663cd665 100644 --- a/include/class/class_acc_bilan.php +++ b/include/class/class_acc_bilan.php @@ -278,6 +278,7 @@ class Acc_Bilan } catch(Exception $Ex) { + record_log($e->getTraceAsString()); echo $Ex->getMessage(); throw $Ex; } diff --git a/include/class/class_acc_ledger.php b/include/class/class_acc_ledger.php index 0788238c5..3fa0cdc39 100644 --- a/include/class/class_acc_ledger.php +++ b/include/class/class_acc_ledger.php @@ -334,6 +334,7 @@ class Acc_Ledger extends jrn_def_sql } catch (Exception $e) { + record_log($e->getTraceAsString()); $this->db->rollback(); throw $e; } @@ -1651,6 +1652,7 @@ class Acc_Ledger extends jrn_def_sql } catch (Exception $e) { + record_log($e->getTraceAsString()); if ($e->getCode() == 1) { echo _("Aucune période ouverte"); @@ -2150,12 +2152,10 @@ class Acc_Ledger extends jrn_def_sql } } - catch (Exception $a) - { - throw $a; - } + catch (Exception $e) { + record_log($e->getTraceAsString()); $this->db->rollback(); echo _('OPERATION ANNULEE '); echo '
Doublon : l'enregistrement n'est pas sauve
"; } @@ -150,6 +151,7 @@ class Anc_Account } catch (Exception $e) { + record_log($e->getTraceAsString()); echo "Doublon : l'enregistrement n'est pas sauve
"; } diff --git a/include/class/class_anc_group_operation.php b/include/class/class_anc_group_operation.php index be88b867a..6bd6de1df 100644 --- a/include/class/class_anc_group_operation.php +++ b/include/class/class_anc_group_operation.php @@ -74,6 +74,7 @@ class Anc_Group_Operation } catch (Exception $e) { + record_log($e->getTraceAsString()); echo $e->getTrace(); $this->db->rollback(); throw new Exception($e); @@ -239,6 +240,7 @@ class Anc_Group_Operation } catch (Exception $ex) { + record_log($e->getTraceAsString()); echo ''. 'Erreur dans l\'enregistrement '. __FILE__.':'.__LINE__.' '. diff --git a/include/class/class_anc_key.php b/include/class/class_anc_key.php index 8467723d5..e2da2578c 100644 --- a/include/class/class_anc_key.php +++ b/include/class/class_anc_key.php @@ -265,8 +265,9 @@ class Anc_Key } catch (Exception $e) { + if ( DEBUG ) { echo $e->getTraceAsString(); } else { echo _('erreur').$e->getMessage();} - error_log($e->getTraceAsString()); + record_log($e->getTraceAsString()); $cn->rollback(); } } diff --git a/include/class/class_anc_operation.php b/include/class/class_anc_operation.php index 042831f3c..119a2bd34 100644 --- a/include/class/class_anc_operation.php +++ b/include/class/class_anc_operation.php @@ -492,7 +492,7 @@ class Anc_Operation } catch (Exception $e) { - var_dump($e); + record_log($e->getTraceAsString()); } } /*!\brief display the form for PA diff --git a/include/class/class_default_menu.php b/include/class/class_default_menu.php index 1419bb43b..64d474671 100644 --- a/include/class/class_default_menu.php +++ b/include/class/class_default_menu.php @@ -106,7 +106,7 @@ class Default_Menu } } catch (Exception $e) { - error_log($e->getTraceAsString()); + record_log($e->getTraceAsString()); echo $e->getMessage(); throw $e; } diff --git a/include/class/class_document_modele.php b/include/class/class_document_modele.php index c42551e23..8a9ba50c6 100644 --- a/include/class/class_document_modele.php +++ b/include/class/class_document_modele.php @@ -191,6 +191,7 @@ class Document_modele } catch (Exception $e) { + record_log($e->getTraceAsString()); rollback($this->cn); return ; } @@ -356,6 +357,7 @@ class Document_modele } catch (Exception $e) { + record_log($e->getTraceAsString()); rollback($this->cn); return ; } diff --git a/include/class/class_document_type.php b/include/class/class_document_type.php index 0630adc15..1a8357e20 100644 --- a/include/class/class_document_type.php +++ b/include/class/class_document_type.php @@ -103,6 +103,7 @@ class Document_type } catch (Exception $e) { + record_log($e->getTraceAsString()); alert(j(_("Impossible d'ajouter [$p_value] ") . $e->getMessage())); } } @@ -119,6 +120,7 @@ class Document_type } catch (Exception $e) { + record_log($e->getTraceAsString()); alert(" Erreur " . $e->getMessage()); } } @@ -131,6 +133,7 @@ class Document_type } catch (Exception $e) { + record_log($e->getTraceAsString()); alert("Erreur " . $e->getMessage()); } } diff --git a/include/class/class_dossier.php b/include/class/class_dossier.php index 9b9fd7890..68f9e1749 100644 --- a/include/class/class_dossier.php +++ b/include/class/class_dossier.php @@ -327,8 +327,9 @@ class Dossier } catch (Exception $e) { + echo_warning($e->getMessage()); - error_log($e->getTraceAsString()); + record_log($e->getTraceAsString()); $cn->rollback(); } } diff --git a/include/class/class_fiche_attr.php b/include/class/class_fiche_attr.php index eaf1d22e4..1e7a140f5 100644 --- a/include/class/class_fiche_attr.php +++ b/include/class/class_fiche_attr.php @@ -99,6 +99,7 @@ class Fiche_Attr $this->cn->exec_sql($this->ad_extra); }catch (Exception $e) { + record_log($e->getTraceAsString()); throw new Exception ("La requête SQL ".h($this->ad_extra)." est invalide "); } } @@ -160,6 +161,7 @@ class Fiche_Attr ); } catch (Exception $e) { + record_log($e->getTraceAsString()); throw $e; } @@ -183,6 +185,7 @@ class Fiche_Attr ); }catch (Exception $e) { + record_log($e->getTraceAsString()); throw $e; } diff --git a/include/class/class_follow_up.php b/include/class/class_follow_up.php index 08425b395..5982f5563 100644 --- a/include/class/class_follow_up.php +++ b/include/class/class_follow_up.php @@ -125,7 +125,7 @@ class Follow_Up { $sql=" ( ag_dest in (select p_granted from user_sec_action_profile where p_id=$profile and ua_right='W' ) )"; } else { - error_log(_('Securité')); + record_log(_('Securité')); throw new Exception(_('Securité')); } return $sql; diff --git a/include/class/class_periode.php b/include/class/class_periode.php index 8f05c77f0..c19c7e7b9 100644 --- a/include/class/class_periode.php +++ b/include/class/class_periode.php @@ -424,6 +424,7 @@ class Periode } catch (Exception $e) { + record_log($e->getTraceAsString()); $this->cn->rollback(); return 1; } @@ -570,6 +571,7 @@ class Periode } catch (Exception $e) { + record_log($e->getTraceAsString()); $this->cn->rollback(); } } diff --git a/include/class/class_pre_op_ach.php b/include/class/class_pre_op_ach.php index 1975a8da7..a8f69f0fd 100644 --- a/include/class/class_pre_op_ach.php +++ b/include/class/class_pre_op_ach.php @@ -103,6 +103,7 @@ class Pre_op_ach extends Pre_operation_detail } catch (Exception $e) { + record_log($e->getTraceAsString()); echo ($e->getMessage()); $this->db->rollback(); } diff --git a/include/class/class_pre_op_advanced.php b/include/class/class_pre_op_advanced.php index f48bd1bfd..a728e39bc 100644 --- a/include/class/class_pre_op_advanced.php +++ b/include/class/class_pre_op_advanced.php @@ -99,6 +99,7 @@ class Pre_Op_Advanced extends Pre_operation_detail } catch (Exception $e) { + record_log($e->getTraceAsString()); echo ($e->getMessage()); $this->db->rollback(); } diff --git a/include/class/class_pre_op_fin.php b/include/class/class_pre_op_fin.php index 25e475207..9316f8727 100644 --- a/include/class/class_pre_op_fin.php +++ b/include/class/class_pre_op_fin.php @@ -86,6 +86,7 @@ class Pre_op_fin extends Pre_operation_detail } catch (Exception $e) { + record_log($e->getTraceAsString()); echo ($e->getMessage()); $this->db->rollback(); } diff --git a/include/class/class_pre_op_ods.php b/include/class/class_pre_op_ods.php index db576ba6b..fa1bbec24 100644 --- a/include/class/class_pre_op_ods.php +++ b/include/class/class_pre_op_ods.php @@ -78,6 +78,7 @@ class Pre_op_ods extends Pre_operation_detail } catch (Exception $e) { + record_log($e->getTraceAsString()); echo ($e->getMessage()); $this->db->rollback(); } diff --git a/include/class/class_pre_op_ven.php b/include/class/class_pre_op_ven.php index d72637061..29a83a41c 100644 --- a/include/class/class_pre_op_ven.php +++ b/include/class/class_pre_op_ven.php @@ -102,6 +102,7 @@ class Pre_op_ven extends Pre_operation_detail } catch (Exception $e) { + record_log($e->getTraceAsString()); echo ($e->getMessage()); $this->db->rollback(); } diff --git a/include/class/class_stock_goods.php b/include/class/class_stock_goods.php index ac451f046..379480a66 100644 --- a/include/class/class_stock_goods.php +++ b/include/class/class_stock_goods.php @@ -165,7 +165,7 @@ class Stock_Goods extends Stock_Goods_Sql } catch (Exception $exc) { - error_log( $exc->getTraceAsString()); + record_log( $exc->getTraceAsString()); echo $exc->getMessage(); throw $exc; } diff --git a/include/lib/class_database.php b/include/lib/class_database.php index f54642deb..e484713aa 100644 --- a/include/lib/class_database.php +++ b/include/lib/class_database.php @@ -200,7 +200,7 @@ class Database echo $a->getTraceAsString(); echo pg_last_error($this->db); } - error_log($a->getTraceAsString()); + record_log($a->getTraceAsString()); $this->rollback(); throw ($a); diff --git a/include/lib/class_noalyss_csv.php b/include/lib/class_noalyss_csv.php index bc83428c9..c01861083 100644 --- a/include/lib/class_noalyss_csv.php +++ b/include/lib/class_noalyss_csv.php @@ -46,7 +46,7 @@ class Noalyss_Csv private function correct_name() { if (trim(strlen($this->filename))==0) { - error_log('CSV->correct_name filename is empty'); + record_log('CSV->correct_name filename is empty'); throw new Exception('CSV-CORRECT_NAME'); } $this->filename.="-".date("ymd-Hi"); diff --git a/include/param_sec.inc.php b/include/param_sec.inc.php index 91609f4b9..4a61d9655 100644 --- a/include/param_sec.inc.php +++ b/include/param_sec.inc.php @@ -183,7 +183,7 @@ if ( isset($_POST['ok'])) catch (Exception $e) { echo_warning ($e->getMessage()); - error_log($e->getTraceAsString()); + record_log($e->getTraceAsString()); $cn->rollback(); } diff --git a/include/profile.inc.php b/include/profile.inc.php index 9ad4aa417..63715e893 100644 --- a/include/profile.inc.php +++ b/include/profile.inc.php @@ -58,7 +58,7 @@ if (isset($_POST['change_profile'])) catch (Exception $exc) { echo $exc->getMessage(); - error_log( $exc->getTraceAsString()); + record_log( $exc->getTraceAsString()); throw $exc; } } @@ -97,7 +97,7 @@ if (isset($_POST['change_stock'])) catch (Exception $exc) { echo $exc->getMessage(); - error_log($exc->getTraceAsString()); + record_log($exc->getTraceAsString()); throw $exc; } }