Closed Bug 1195351 Opened 5 years ago Closed 5 years ago

Live sample "Open in Codepen/JSFiddle" - should gracefully handle errors


( Graveyard :: General, defect)

Not set


(Not tracked)



(Reporter: shobson, Unassigned)



(Keywords: in-triage)

Rather than opening a blank pen or fiddle if the script can't find any code it should not place buttons on the page.

It should also log an error in google analytics so we can find and fix instances of these.

:sheppy can you confirm for me that there are samples that may just have HTML? Are there any that are just CSS or just JS?
Flags: needinfo?(eshepherd)
Yes, there may be samples that are just HTML. JS-only samples are also possible although we're not doing them yet since there's no way for them to present output yet (we have a bug filed for that, in fact). There wouldn't be a CSS-only sample though.
Flags: needinfo?(eshepherd)
Example URL?  What would trigger this case?
Bug 1194482 triggered this use case before it was fixed.

I assume there are other places where the script is failing, we just don't know about them yet. In those cases I would like to not display the faulty button to the users and log an error in Google Analytics - rather than relying on annoyed users to report bugs.
I'm not understanding what "failure" means.  Section address it was requesting was wrong?  Didn't parse any code content?  Got code content but didn't all transfer over to CodePen/JSFiddle?  No example URL or specific use case makes this difficult.
It wasn't passing any code. CSS, HTML, and JS were all empty. 

In cases where CSS, HTMl, and JS fields would all be empty we shouldn't show the buttons and we should log an error in Google Analytics.
Commits pushed to master at
Fix Bug 1195351 and Fix Bug 1198301 (Live Sample "open in" buttons)

Re-jigged when the sample sections are downloaded so they are parsed by the script to make sure there's code in them before we add the buttons to the page, log errors with GA if something goes wrong there.
Merge pull request #3633 from stephaniehobson/1195351-empty-live-sample

Fix bugs 1195351 and 1198301: (Live Sample "open in" buttons)
Closed: 5 years ago
Resolution: --- → FIXED
Product: → Graveyard
You need to log in before you can comment on or make changes to this bug.