Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(157)

Issue 199073: Proposal #1: return simple DOM with error text when relevant (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 7 months ago by johnfargo
Modified:
15 years, 7 months ago
Reviewers:
shindig.remailer
Base URL:
http://svn.apache.org/repos/asf/incubator/shindig/trunk/
Visibility:
Public.

Description

This patch returns a bare-bones DOM that includes error info from a DOMException generated by parsing invalid text. The purpose is to echo the error text back to a gadget developer rather than obscure it without any context. The implementation isn't perfect in that it would arguably be better for MutableContent.getDocument() to throw a suitable Exception on parse failure. However, doing so changes the MutableContent API to throw a checked Exception, which could force several downstream API changes. An alternative would be to add a MutableContent.checkDocument() API that does throw an exception, whose use would be isolated to HtmlRenderer. This forces DOM parsing before any rewriters are run, however, which has non-trivial performance impact when String-based rewriters are run. This implementation's main semantic downside is that the status code returned for an erroring-render is 200 rather than 404. Input welcome.

Patch Set 1 #

Patch Set 2 : Test fix and small cleanup. #

Messages

Total messages: 2
johnfargo
15 years, 7 months ago (2010-02-03 03:08:02 UTC) #1
johnfargo
15 years, 7 months ago (2010-02-03 19:24:12 UTC) #2
Test fix and small cleanup.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b