<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>21876</bug_id>
          
          <creation_ts>2013-04-30 12:48:56 +0000</creation_ts>
          <short_desc>It would be nice to distinguish error events. For example, specific errors should be generated for access control failures and for different kinds of underlying network failures.</short_desc>
          <delta_ts>2013-06-18 23:27:55 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#event-source-fail-reasons</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>dirkjan</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>87003</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-04-30 12:48:56 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/comms.html
Multipage: http://www.whatwg.org/C#event-source-fail-reasons
Complete: http://www.whatwg.org/c#event-source-fail-reasons
Referrer: 

Comment:
It would be nice to disable error events. For example, specific errors should
be generated for access control failures and for different kinds of underlying
network failures.

Posted from: 85.223.109.191
User agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:22.0) Gecko/20130428 Firefox/22.0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87005</commentid>
    <comment_count>1</comment_count>
    <who name="Dirkjan Ochtman">dirkjan</who>
    <bug_when>2013-04-30 13:20:07 +0000</bug_when>
    <thetext>I ran into this while testing EventSource today (as a somewhat unsuspecting webdev who does some Mozilla things once in a while). I actually ran into two problems that could be much easier to debug (seemingly without incurring a large implementation burden).

- Require implementations to raise errors on connection soon after actually connecting. Gecko apparently doesn&apos;t do this: https://bugzilla.mozilla.org/show_bug.cgi?id=780396.

- Require implementations to throw more specific error events. I filed https://bugzilla.mozilla.org/show_bug.cgi?id=867105 about access control / CORS.

Combined, these made for a big WTF on my first try of implementing this. I was suspecting CORS errors to be raised immediately (and clearly). Instead, I got a generic error only after getting the server to send a first event.

The second WTF was generic failure on timeout. My server requires setting a heartbeat explicitly, so making it clear that there was a timeout would have made this much easier. I suspect the usual network error suspects should have somewhat specific errors, at least.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>87033</commentid>
    <comment_count>2</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-04-30 18:18:45 +0000</bug_when>
    <thetext>We should definitely encourage browsers to report detailed errors to their consoles, but we can&apos;t report detailed errors to the script, because that would allow this to be used to do intranet port-scanning and resource discovery, which would be a huge security problem.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>88115</commentid>
    <comment_count>3</comment_count>
    <who name="Dirkjan Ochtman">dirkjan</who>
    <bug_when>2013-05-23 07:17:17 +0000</bug_when>
    <thetext>Is there anything I can do to help move this forward?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89128</commentid>
    <comment_count>4</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-06-11 22:15:19 +0000</bug_when>
    <thetext>One thing to do would be to file bugs on the browsers directly, asking for more information, giving specific examples (test cases) where the current debugging information is inadequate.

As far as the spec goes, I can add some suggestions in the EventSource section saying that in case of errors, detailed information should be logged so the developer can see it, would that help?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89149</commentid>
    <comment_count>5</comment_count>
    <who name="Dirkjan Ochtman">dirkjan</who>
    <bug_when>2013-06-12 07:19:00 +0000</bug_when>
    <thetext>As I mentioned in comment 1, I already filed bugs about this for Gecko. WebKit/Blink already log CORS errors to the console, at least. This bug was filed based on suggestion there, see https://bugzilla.mozilla.org/show_bug.cgi?id=867105#c1.

So yes, it would be helpful if you could add some suggestions to the spec. CORS errors and underlying network errors would seem like no-brainer cases to me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89520</commentid>
    <comment_count>6</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-06-18 23:25:51 +0000</bug_when>
    <thetext>I&apos;ve added a section (see diff below). Please do file a new bug if you see anything else that we should encourage user agents to report. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>89521</commentid>
    <comment_count>7</comment_count>
    <who name="">contributor</who>
    <bug_when>2013-06-18 23:27:55 +0000</bug_when>
    <thetext>Checked in as WHATWG revision r7988.
Check-in comment: Encourage more detailed debugging aids for EventSource
http://html5.org/tools/web-apps-tracker?from=7987&amp;to=7988</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>