From e6a0ca5042e78631f24cfebf98d58513b2595a1d Mon Sep 17 00:00:00 2001 From: lvessiller Date: Thu, 7 Apr 2022 16:32:08 +0200 Subject: [PATCH] FIX errors to catch --- htdocs/core/class/commonobject.class.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index cc3ea5ae820..ea7de60f67e 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5380,19 +5380,20 @@ abstract class CommonObject return 1; } else { $outputlangs->charset_output = $sav_charset_output; + $this->error = $obj->error; + $this->errors = $obj->errors; dol_syslog("Error generating document for ".__CLASS__.". Error: ".$obj->error, LOG_ERR); - setEventMessages($obj->error, $obj->errors, 'errors'); return -1; } } else { if (!$filefound) { $this->error = $langs->trans("Error").' Failed to load doc generator with modelpaths='.$modelspath.' - modele='.$modele; + $this->errors[] = $this->error; dol_syslog($this->error, LOG_ERR); - setEventMessage($this->error, 'errors'); } else { $this->error = $langs->trans("Error")." ".$langs->trans("ErrorFileDoesNotExists", $filefound); + $this->errors[] = $this->error; dol_syslog($this->error, LOG_ERR); - setEventMessage($this->error, 'errors'); } return -1; }