Michal Fojtik
http://deltacloud.org
[email protected]



On Feb 28, 2012, at 12:32 AM, David Lutterkort wrote:

> On Mon, 2012-02-27 at 16:48 +0100, [email protected] wrote:
>> From: Michal Fojtik <[email protected]>
>> 
>> 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.
>> 
>> Signed-off-by: Michal fojtik <[email protected]>
> 
> ACK. One comment:
> 
>> diff --git a/server/lib/deltacloud/base_driver/exceptions.rb 
>> b/server/lib/deltacloud/base_driver/exceptions.rb
>> index e30f94c..08f2683 100644
>> --- a/server/lib/deltacloud/base_driver/exceptions.rb
>> +++ b/server/lib/deltacloud/base_driver/exceptions.rb
>> @@ -175,9 +175,10 @@ 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($!)
>> -            raise exdef.handler($!) if new_exception
>> +            m = new_exception.message.nil? ? $1.message : 
>> new_exception.message
> 
> That $1 is supposed to be a $!, right ?

Yes, seems like brain overflow. Thanks for spotting that.

  -- Michal

Reply via email to