Skip to content

Commit

Permalink
FIX: Don't try to parse the error response
Browse files Browse the repository at this point in the history
We'll regret this if the server ever sends a full error page with styles and everything
  • Loading branch information
wosc committed Feb 26, 2024
1 parent ad61788 commit eac0183
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 1 addition & 0 deletions core/docs/changelog/ZO-4801.change
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ZO-4801: Display request errors that occur in JS forms
5 changes: 1 addition & 4 deletions core/src/zeit/cms/browser/js/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,7 @@ zeit.cms.SubPageForm = gocept.Class.extend({
d.addCallbacks(
MochiKit.Base.bind(self.replace_content, self),
function(error) {
var parser = new DOMParser();
var doc = parser.parseFromString(
error.req.responseText, "text/xml");
document.firstChild.nextSibling.nextSibling.innerHTML = doc.firstChild.nextSibling.innerHTML;
alert('JS request failed: ' + error.req.responseText);
});
d.addCallback(MochiKit.Base.bind(self.process_post_result, self));
d.addCallback(function(result) {
Expand Down

0 comments on commit eac0183

Please sign in to comment.