You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by mf...@apache.org on 2012/02/29 16:38:21 UTC
[3/3] git commit: Core: Display user-defined exception message
Core: Display user-defined exception message
The exception handling DSL we're using allow user
to define custom exception message using the 'message'
directive. This message is then used in XML/HTML view
and client can fetch it.
However DC logs the original error message to system log.
This patch should make DC log user-defined message to log.
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/7ee08d5a
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/7ee08d5a
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/7ee08d5a
Branch: refs/heads/master
Commit: 7ee08d5a7119fc31d0cc754802a4582854b98ba5
Parents: d6b5929
Author: Michal Fojtik <mf...@redhat.com>
Authored: Mon Feb 27 16:40:36 2012 +0100
Committer: Michal fojtik <mf...@redhat.com>
Committed: Wed Feb 29 16:39:13 2012 +0100
----------------------------------------------------------------------
server/lib/deltacloud/base_driver/exceptions.rb | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/7ee08d5a/server/lib/deltacloud/base_driver/exceptions.rb
----------------------------------------------------------------------
diff --git a/server/lib/deltacloud/base_driver/exceptions.rb b/server/lib/deltacloud/base_driver/exceptions.rb
index ccb942d..a89b05f 100644
--- a/server/lib/deltacloud/base_driver/exceptions.rb
+++ b/server/lib/deltacloud/base_driver/exceptions.rb
@@ -175,7 +175,6 @@ module Deltacloud
report_method = $stderr.respond_to?(:err) ? :err : :puts
Deltacloud::ExceptionHandler::exceptions.each do |exdef|
if exdef.match?($!)
- $stderr.send(report_method, "#{[$!.class.to_s, $!.message].join(':')}\n#{$!.backtrace.join("\n")}")
new_exception = exdef.handler($!)
m = new_exception.message.nil? ? $!.message : new_exception.message
$stderr.send(report_method, "#{[$!.class.to_s, m].join(':')}\n#{$!.backtrace[0..10].join("\n")}")