Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #9940 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

TemplateError in exception_notifier/_environment.rhtml

Reported by: djwonk Assigned to: core
Priority: high Milestone:
Component: Plugins Version:
Severity: major Keywords: exception_notification, exception_notifier, verified
Cc: shingara, pcowans

Description

The exception_notification plugin gives this exception under ruby 1.8.6 patchlevel 110:

ActionView::TemplateError (flag after width) on line #3 of ....../vendor/plugins/exception_notification/views/exception_notifier/_environment.rhtml

The offending line is:

<%= "%*-s: %s" % [max.length, key,
filter_sensitive_post_data_from_env(key, @request.env
[key].to_s.strip)] %>

The fix is simple, just switch the places of * and -

<%= "%-*s: %s" % [max.length, key,
filter_sensitive_post_data_from_env(key, @request.env
[key].to_s.strip)] %>

To diagnose the problem, I played around with irb using these two simplifications:

  1. puts "%-*s: %s" % [5, 2, 'strange']
  2. puts "%*-s: %s" % [5, 2, 'strange']

Results of testing:

  1. works both on my Mac and my Ubuntu Feisty server.
  2. only works on my Mac.

My Mac runs ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.9.1]. My Ubuntu Feisty Server runs ruby 1.8.6 (2007-09-23 patchlevel 110) [x86_64-linux]

Change History

10/24/07 20:18:51 changed by shingara

  • cc set to shingara.

10/28/07 18:19:09 changed by eszter

I can confirm the problem and the fix. +1 from me

10/30/07 19:34:45 changed by aselder

Another confirmation for the problem and fix.

10/30/07 19:45:32 changed by aselder

  • priority changed from normal to high.
  • severity changed from normal to major.

10/31/07 18:29:11 changed by jsboulanger

I had the same problem and the fix worked. +1

11/10/07 16:31:49 changed by pcowans

  • cc changed from shingara to shingara, pcowans.

11/14/07 03:28:49 changed by meekish

Had same problem; fix worked. +1

11/14/07 17:27:25 changed by jw

  • keywords changed from exception_notification, exception_notifier to exception_notification, exception_notifier, verified.

+1 from me, tested on Ruby 1.8.6p110 on OS X 10.5

11/15/07 03:52:40 changed by fedot

Another +1 for the problem and the fix. Would love to see this simple change rolled out soon, as my rails app uses this plugin through svn:externals and I can't simply fix it locally.

11/23/07 16:28:09 changed by minam

  • status changed from new to closed.
  • resolution set to fixed.

fixed in [8191]