Hi Michal, I've added safely's to all my methods dealing with the backend and noticed that for some operations the GUI shows the error message with stacktrace but with others it does not. Why the inconsistency?
I get a proper error page with all the instances, addresses, hardware_profiles, loadbalancers, etc. operations. No error page with: - create_address (Create new address seems to do nothing) - create_loadbalancer (After pressing 'create', a message "Error Loading Page" is displayed for half a second) - create_storage_volume (After pressing 'create', a message "Error Loading Page" is displayed for half a second) - create_storage_snapshot (After pressing 'create', a message "Error Loading Page" is displayed for half a second) Regards, Dies Koper > -----Original Message----- > From: Michal Fojtik [mailto:[email protected]] > Sent: Friday, 13 April 2012 12:17 AM > To: [email protected] > Subject: Re: how to better log errors during development > > Hi Dies, > > We're using a small DSL for capturing and dealing with different kind > of errors that came from backend provider. For that we have the 'safely', > block that you can see in many existing drivers. > > A sample of using this: > > def instances(credentials, opts={}) > client = new_client(...) > safely do > # do something that is can throw exception > end > end > > Then somewhere on bottom of the driver file, you can see this: > > exceptions do > > on /(AuthFailure|InvalidKey)/ do > status 401 # HTTP_AUTH > end > > on /Error/ do > status 502 # Provider error > end > > end > > Then all exceptions are captured by this system and delivered to clients > in XML or JSON format with full backtrace. > > -- Michal > > Michal Fojtik > http://deltacloud.org > [email protected] > > > > On Apr 12, 2012, at 3:56 AM, Koper, Dies wrote: > > > Hi, > > > > While developing the FGCP driver, I often introduce bugs where I invoke > > [] on a nil object. > > When using the DC GUI, this causes the following backtrace: > > > > NoMethodError - undefined method `code' for > #<NameError:0x7fe779972da0>: > > > > > /mnt/hgfs/deltacloud/server/lib/deltacloud/helpers/application_helper.rb > > :69:in `filter_all' > > /mnt/hgfs/deltacloud/server/lib/deltacloud/server.rb:676 > > > > The line is: > > > > report_error(@exception.code) > > > > If I add a 'puts @exception.backtrace' in front of it it at least logs > > the backtrace to the bug in my bug. > > > > Can we introduce such a chance here, and if we do, what kind of change > > would fit best? > > > > Thanks, > > Dies Koper > > >
