noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 06/17: Use error_log with exception to log ge


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 06/17: Use error_log with exception to log getTraceAsString
Date: Fri, 02 Oct 2015 10:22:17 +0000

sparkyx pushed a commit to branch master
in repository noalyss.

commit fde9e92da9e4f3864a9ad331a4ede4d5f250a1e2
Author: Dany De Bontridder <address@hidden>
Date:   Tue Sep 15 11:27:23 2015 +0200

    Use error_log with exception  to log getTraceAsString
---
 include/class/class_acc_ledger_purchase.php |    2 +-
 include/class/class_anc_key.php             |    2 +-
 include/class/class_default_menu.php        |    3 ++-
 include/class/class_stock_goods.php         |    5 +++--
 include/lib/class_database.php              |    1 +
 include/param_sec.inc.php                   |    3 ++-
 include/profile.inc.php                     |    6 ++++--
 7 files changed, 14 insertions(+), 8 deletions(-)

diff --git a/include/class/class_acc_ledger_purchase.php 
b/include/class/class_acc_ledger_purchase.php
index 716303e..f057f42 100644
--- a/include/class/class_acc_ledger_purchase.php
+++ b/include/class/class_acc_ledger_purchase.php
@@ -908,7 +908,7 @@ class  Acc_Ledger_Purchase extends Acc_Ledger
             echo '<span class="error">'.
             'Erreur dans l\'enregistrement '.
             __FILE__.':'.__LINE__.' '.
-            $e->getMessage().$e->getTraceAsString();
+            $e->getMessage().$e->getMessage();
             error_log($e->getMessage());
             $this->db->rollback();
             throw  new Exception($e);
diff --git a/include/class/class_anc_key.php b/include/class/class_anc_key.php
index aef741f..a1a99a2 100644
--- a/include/class/class_anc_key.php
+++ b/include/class/class_anc_key.php
@@ -265,7 +265,7 @@ class Anc_Key
         }
         catch (Exception $e)
         {
-            if ( DEBUG ) { echo $e->getTraceAsString(); } else { echo 
_('erreur');}
+            if ( DEBUG ) { echo $e->getTraceAsString(); } else { echo 
_('erreur').$e->getMessage();}
             error_log($e->getTraceAsString());
             $cn->rollback();
         }
diff --git a/include/class/class_default_menu.php 
b/include/class/class_default_menu.php
index 7aa595d..1419bb4 100644
--- a/include/class/class_default_menu.php
+++ b/include/class/class_default_menu.php
@@ -106,7 +106,8 @@ class Default_Menu
             }
         } catch (Exception $e)
         {
-            $e->getTraceAsString();
+            error_log($e->getTraceAsString());
+            echo $e->getMessage();
             throw $e;
         }
     }
diff --git a/include/class/class_stock_goods.php 
b/include/class/class_stock_goods.php
index cfbd681..96a817a 100644
--- a/include/class/class_stock_goods.php
+++ b/include/class/class_stock_goods.php
@@ -165,8 +165,9 @@ class Stock_Goods extends Stock_Goods_Sql
                }
                catch (Exception $exc)
                {
-                       echo $exc->getTraceAsString();
-                       throw $exc;
+                    error_log( $exc->getTraceAsString());
+                    echo $exc->getMessage();
+                    throw $exc;
                }
        }
         /**
diff --git a/include/lib/class_database.php b/include/lib/class_database.php
index 87ad5fa..da167e1 100644
--- a/include/lib/class_database.php
+++ b/include/lib/class_database.php
@@ -177,6 +177,7 @@ class Database
                 echo $a->getTraceAsString();
                 echo pg_last_error($this->db);
             }
+            error_log($a->getTraceAsString());
             $this->rollback();
             
             throw ($a);
diff --git a/include/param_sec.inc.php b/include/param_sec.inc.php
index bc8b52e..1149df1 100644
--- a/include/param_sec.inc.php
+++ b/include/param_sec.inc.php
@@ -182,7 +182,8 @@ if ( isset($_POST['ok']))
        } // end try
        catch (Exception $e)
        {
-               echo_warning ($e->getTraceAsString());
+               echo_warning ($e->getMessage());
+               error_log($e->getTraceAsString());
                $cn->rollback();
        }
 
diff --git a/include/profile.inc.php b/include/profile.inc.php
index e590df6..eb5a388 100644
--- a/include/profile.inc.php
+++ b/include/profile.inc.php
@@ -57,7 +57,8 @@ if (isset($_POST['change_profile']))
     }
     catch (Exception $exc)
     {
-        echo $exc->getTraceAsString();
+        echo $exc->getMessage();
+        error_log( $exc->getTraceAsString());
         throw $exc;
     }
 }
@@ -95,7 +96,8 @@ if (isset($_POST['change_stock']))
     }
     catch (Exception $exc)
     {
-        echo $exc->getTraceAsString();
+        echo $exc->getMessage();
+        error_log($exc->getTraceAsString());
         throw $exc;
     }
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]