fix for notifier.js sending invalid XML #514

Merged
merged 1 commit into from Jul 8, 2013

Projects

None yet

3 participants

@mildavw
Contributor
mildavw commented Jul 2, 2013

I'm getting a Self.Errbit error "Nokogiri::XML::SyntaxError: EntityRef: expecting ';'" when one of my apps reports an error. The following is the XML which is invalid at line 11. This fix just wraps the message with CDATA so Nokogiri doesn't try to parse it. Also wrapped the backtrace just in case.

1 <?xml version=\"1.0\" encoding=\"UTF-8\"?>
2 <notice version=\"2.0\">
3   <api-key>xxxx</api-key>
4   <notifier>
5     <name>airbrake_js</name>
6     <version>0.2.0</version>
7     <url>http://airbrake.io</url>
8   </notifier>
9   <error>
10     <class>Error</class>
11     <message>Uncaught Syntax error, unrecognized expression: [href=#bayarea?utm_source=2nd+BayREN+MF+Workshop+Invite+July&utm_campaign=July+workshop+announcement&utm_medium=email]</message>
12     <backtrace>
13       <line method=\"{anonymous}()\" file=\"[PROJECT_ROOT]/assets/vendor-8e6fab5606aee4bf5e34551808868bd7.js\" number=\"17\" />
14     </backtrace>
15   </error>
16   <request>
17     <url>https://multifamily.energyupgradeca.org/local</url>
18     <component>contents</component>
19     <action>show</action>
20     <cgi-data>
21       <var key=\"HTTP_USER_AGENT\">Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.63 Safari/537.36</var>
22     </cgi-data>
23   </request>
24   <server-environment>
25     <project-root>https://multifamily.energyupgradeca.org</project-root>
26     <environment-name>production</environment-name>
27   </server-environment>
28 </notice>
@coveralls

Coverage Status

Coverage remained the same when pulling 95b4c97 on mildavw:master into bf7175e on errbit:master.

@coveralls

Coverage Status

Coverage remained the same when pulling 95b4c97 on mildavw:master into bf7175e on errbit:master.

@coveralls

Coverage Status

Coverage remained the same when pulling 5c2ed54 on mildavw:master into bf7175e on errbit:master.

@coveralls

Coverage Status

Coverage remained the same when pulling 5c2ed54 on mildavw:master into bf7175e on errbit:master.

@shingara
Member
shingara commented Jul 3, 2013

You right. Can you rebase it in only one commit please ?

@coveralls

Coverage Status

Coverage remained the same when pulling 6c30142 on mildavw:master into bf7175e on errbit:master.

@shingara
Member
shingara commented Jul 8, 2013

Thanks

@shingara shingara merged commit abc2fae into errbit:master Jul 8, 2013

1 check passed

default The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment