Nack. I don't think it's a good idea to start putting messages specific to one provider in the common haml files. If we start doing that with all messages from all providers, it's going to be a big mess.
Maybe the driver can raise a particular class of (common) error for which the backtrace is not logged? Before that, I don't think the driver should be raising a 5xx for this error. 5xx's are for problems with the server. They're of the type that you would contact your system administrator for to fix the server. Trying to delete a template that is in use, sounds like a user error; "412 Precondition Failed" or "405 Method Not Allowed" seems more appropriate. Regards, Dies Koper > -----Original Message----- > From: [email protected] [mailto:[email protected]] > Sent: Saturday, 8 December 2012 4:10 AM > To: [email protected] > Subject: [PATCH] DTACLOUD-379 catch and handle in haml > > From: Joe VLcek <[email protected]> > > --- > server/views/errors/500.html.haml | 3 ++- > server/views/errors/500.xml.haml | 3 ++- > 2 files changed, 4 insertions(+), 2 deletions(-) > > diff --git a/server/views/errors/500.html.haml > b/server/views/errors/500.html.haml > index 8cd3c74..0fa4563 100644 > --- a/server/views/errors/500.html.haml > +++ b/server/views/errors/500.html.haml > @@ -16,7 +16,8 @@ > %em No details > %li{ :'data-role' => 'list-divider'} Backtrace > %li > - %pre= bt @error.backtrace > + - unless @error.message.downcase.gsub(/\s+/," ").include?('cannot > delete template. template is being used') > + %pre= bt @error.backtrace > > - if @error.backtrace > %div{ 'data-role' => :collapsible, 'data-collapsed' => "true"} > diff --git a/server/views/errors/500.xml.haml > b/server/views/errors/500.xml.haml > index b3e71e2..11aa4e1 100644 > --- a/server/views/errors/500.xml.haml > +++ b/server/views/errors/500.xml.haml > @@ -6,7 +6,8 @@ > %code=response.status > %message< #{cdata @error.message} > - if @error.respond_to?(:backtrace) and [email protected]? > - %backtrace=cdata(@error.backtrace.join("\n")) > + - unless @error.message.downcase.gsub(/\s+/," ").include?('cannot > delete template. template is being used') > + %backtrace=cdata(@error.backtrace.join("\n")) > - if params > %request > - params.each do |k, v| > -- > 1.7.11.7 >
