diff --git a/gulliver/system/class.g.php b/gulliver/system/class.g.php index 9c3ead4e0..095123104 100644 --- a/gulliver/system/class.g.php +++ b/gulliver/system/class.g.php @@ -526,13 +526,13 @@ class G $oHeadPublisher->clearScripts(); $oHeadPublisher->leimnudInitString = $leimnudInitString; $oHeadPublisher->addScriptFile( '/js/maborak/core/maborak.js' ); - $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', null, array ('MESSAGE' => $e->getMessage() + $G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'login/showMessage', null, array ('MESSAGE' => self::getErrorMessage($e) ) ); if (class_exists( 'SkinEngine' )) { $skinEngine = new SkinEngine( 'publish', 'blank', '' ); $skinEngine->dispatch(); } else { - die( $e->getMessage() ); + die( self::getErrorMessage($e) ); } } } @@ -5657,6 +5657,18 @@ class G { return crc32($string); } + + /** + * this function get the Message + * @access public + * @param string $e + * @return string + * + */ + public static function getErrorMessage($e) + { + return $e->getMessage(); + } } /** diff --git a/workflow/engine/bin/tasks/cliAddons.php b/workflow/engine/bin/tasks/cliAddons.php index 1fdffd8cf..37a44d61c 100644 --- a/workflow/engine/bin/tasks/cliAddons.php +++ b/workflow/engine/bin/tasks/cliAddons.php @@ -133,7 +133,7 @@ function change_hash($command, $opts) $workspace->close(); CLI::logging(pakeColor::colorize("Changed...", "ERROR") . "\n"); } catch (Exception $e) { - echo "> Error: ".CLI::error($e->getMessage()) . "\n"; + echo "> Error: ".CLI::error(G::getErrorMessage($e)) . "\n"; } } } diff --git a/workflow/engine/bin/tasks/cliMafe.php b/workflow/engine/bin/tasks/cliMafe.php index d1b0f35d1..e185a769e 100644 --- a/workflow/engine/bin/tasks/cliMafe.php +++ b/workflow/engine/bin/tasks/cliMafe.php @@ -62,7 +62,7 @@ function run_create_translation($args, $opts) echo "Updating labels for workspace " . pakeColor::colorize($workspace->name, "INFO") . "\n"; $translation->generateTransaltionMafe($lang); } catch (Exception $e) { - echo "Errors upgrading labels for workspace " . CLI::info($workspace->name) . ": " . CLI::error($e->getMessage()) . "\n"; + echo "Errors upgrading labels for workspace " . CLI::info($workspace->name) . ": " . CLI::error(G::getErrorMessage($e)) . "\n"; } } diff --git a/workflow/engine/classes/class.labelsGmail.php b/workflow/engine/classes/class.labelsGmail.php index a0771a6d7..f7bcc290b 100644 --- a/workflow/engine/classes/class.labelsGmail.php +++ b/workflow/engine/classes/class.labelsGmail.php @@ -13,7 +13,7 @@ class labelsGmail $labels = array_merge($labels, $labelsResponse->getLabels()); } } catch (Exception $e) { - print G::LoadTranslation("ID_PMGMAIL_GENERAL_ERROR") . $e->getMessage(); + print G::LoadTranslation("ID_PMGMAIL_GENERAL_ERROR") . G::getErrorMessage($e); throw ($e); } return $labels; @@ -37,7 +37,7 @@ class labelsGmail try { $message = $service->users_messages->modify($userId, $messageId, $mods); } catch (Exception $e) { - print G::LoadTranslation("ID_PMGMAIL_GENERAL_ERROR") . $e->getMessage(); + print G::LoadTranslation("ID_PMGMAIL_GENERAL_ERROR") . G::getErrorMessage($e); throw ($e); } } @@ -69,7 +69,7 @@ class labelsGmail $messages = array_merge($messages, $messagesResponse->getMessages()); } } catch (Exception $e) { - print G::LoadTranslation("ID_PMGMAIL_GENERAL_ERROR") . $e->getMessage(); + print G::LoadTranslation("ID_PMGMAIL_GENERAL_ERROR") . G::getErrorMessage($e); throw ($e); } } while ($pageToken);