[FIX] get_file error: the exception can be the only node and must be json parsed
bzr revid: sle@openerp.com-20140414105333-05jona7myntifamw
This commit is contained in:
@@ -460,14 +460,11 @@ instance.web.Session.include( /** @lends instance.web.Session# */{
|
||||
.appendTo(document.body)
|
||||
.load(function () {
|
||||
try {
|
||||
if (options.error) {
|
||||
if (!this.contentDocument.body.childNodes[1]) {
|
||||
options.error(this.contentDocument.body.childNodes);
|
||||
}
|
||||
else {
|
||||
options.error(JSON.parse(this.contentDocument.body.childNodes[1].textContent));
|
||||
}
|
||||
}
|
||||
if (options.error) {
|
||||
var body = this.contentDocument.body;
|
||||
var node = body.childNodes[1] || body.childNodes[0];
|
||||
options.error(JSON.parse(node.textContent));
|
||||
}
|
||||
} finally {
|
||||
complete();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user