diff --git a/template/app/controller/DocTests.js b/template/app/controller/DocTests.js index ea09c7695c098c1dc6bb66a02fa9a33f2fc9f2e0..705ee1bebce381eb53ba52040736f3727acb4aa1 100644 --- a/template/app/controller/DocTests.js +++ b/template/app/controller/DocTests.js @@ -103,18 +103,33 @@ Ext.define('Docs.controller.DocTests', { }); }, this); - this.classesLeft--; - if (this.classesLeft === 0) { - this.getIndex().enable(); - } + this.countClassLoaded(); }, failure: function(response, opts) { - console.log('Class load failed', cls, url, response, opts); + this.getIndex().addExample({ + id: cls, + name: cls, + href: document.location.href.replace(/#.*/, '#!/api/' + cls), + code: 'ClassLoadingFailed();', + status: 'failure', + message: 'Class loading failed' + }); + + this.countClassLoaded(); }, scope: this }); }, + // Counts that yet another class has been loaded. + // When all loaded, enable the page again. + countClassLoaded: function() { + this.classesLeft--; + if (this.classesLeft === 0) { + this.getIndex().enable(); + } + }, + /** * Extract example code from html. * diff --git a/template/app/view/doctests/Index.js b/template/app/view/doctests/Index.js index ba95c2db351025500fdfd4b116eb87fc56c12768..abe47226e856b6b7557a41bf82f9d27511719e78 100644 --- a/template/app/view/doctests/Index.js +++ b/template/app/view/doctests/Index.js @@ -248,10 +248,6 @@ Ext.define('Docs.view.doctests.Index', { record.commit(); config.pass++; this.showResult(config); - - if (Ext.isDefined(console)) { - console.log('Test passed: ', record.get('name')); - } }, /** @@ -271,13 +267,5 @@ Ext.define('Docs.view.doctests.Index', { record.commit(); config.fail++; this.showResult(config); - - if (Ext.isDefined(console)) { - var stack = 'no stack available'; - if (e.stack) { - stack = e.stack; - } - console.log('Test failure for ' + record.get('name'), e, stack); - } } });