~openerp-dev/openerp-web/trunk-website-backend-integration-sle-csn

« back to all changes in this revision

Viewing changes to addons/web/static/src/js/core.js

  • Committer: Simon Lejeune
  • Date: 2014-04-29 13:23:19 UTC
  • mfrom: (3973.1.9 openerp-web)
  • Revision ID: sle@openerp.com-20140429132319-gfp2hlaj1qlatt50
[FIX] core.js get_file method: correctly extract exception from body

Show diffs side-by-side

added added

removed removed

Lines of Context:
460
460
            .appendTo(document.body)
461
461
            .load(function () {
462
462
                try {
463
 
                   if (options.error) {
464
 
                         if (!this.contentDocument.body.childNodes[1]) {
465
 
                            options.error(this.contentDocument.body.childNodes);
466
 
                        }
467
 
                        else {
468
 
                            options.error(JSON.parse(this.contentDocument.body.childNodes[1].textContent));
469
 
                        }
470
 
                   }
 
463
                    if (options.error) {
 
464
                        var body = this.contentDocument.body;
 
465
                        var node = body.childNodes[1] || body.childNodes[0];
 
466
                        options.error(JSON.parse(node.textContent));
 
467
                    }
471
468
                } finally {
472
469
                    complete();
473
470
                }