I'm not exactly sure what folks are suggesting without seeing code, so I may be repeating someone else's suggestion, but I would:
1) Use exactly as many Event classes as the Browser supports, even if it is less than what Flash supports. 2) Use exactly as many Event types (the name of the event) as the Browser supports, even if it is different than what Flash supports. 3) Figure out a way to determine what extra information Flash might be able to offer. Maybe a "relatedData" property in the event object, or a "lastPlatformError". 4) Consider whether there is enough information in the JS errors/events that someday, not necessarily now, someone could map the strings from a JS CORS error to the equivalent Flash error, and then we'd offer more Event classes or Event types. Also, future browsers may offer more errors/events. We don't really want application developers to have to turn on conditional compilation. They could, however, write "if" statements that look for additional related data and then do something else. My two cents, -Alex On 7/7/16, 6:29 AM, "Christofer Dutz" <christofer.d...@c-ware.de> wrote: >And I still think it would be great if one type was used but >platform-specific sub-types were thrown. > > >Chris > >________________________________ >Von: Yishay Weiss <yishayj...@hotmail.com> >Gesendet: Donnerstag, 7. Juli 2016 15:13:55 >An: Harbs; dev >Betreff: RE: [FlexJS]HTTP events > >I also like option (2), but I think it can be merged with (1). If the >event names are constants, we can conditionally compile the constants. >That way the IDE won’t code complete events that are not implemented. The >framework class (e.g. URLBinaryLoader) can conditionally compile to >handle the flash events if they exist. That way we provide the flash user >with full functionality and don’t confuse the JS user. > > > >From: Harbs<mailto:harbs.li...@gmail.com> >Sent: Thursday, July 7, 2016 3:11 PM >To: dev<mailto:dev@flex.apache.org> >Subject: [FlexJS]HTTP events > >I’m working on full event handling for HTTP requests. Most of the events >should work the same for both Flash and JS. The primary exception is >security events. Browsers do not differentiate between general connection >errors and CORS (i.e. security) errors. There’s no way to examine the >request to know why it failed. > >There’s two ways we can handle the difference between Flash and Browser >behaviors: >1. We can dispatch specific events for SECURITY and IO errors in Flash, >while dispatching a single error event for JS. >2. We can dispatch a single “CONNECTION_ERROR” event for all platforms no >matter what the reason. > >I’m leaning towards doing it the second way for cross-platform simplicity >sake. If someone wants to handle IO and SECURITY errors differently on >the Flash side, they can use conditional compiling. > >Any objections? > >Harbs