File tree 2 files changed +17
-1
lines changed
2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 401
401
402
402
// если в моделях есть ошибки или мы превысили лимит перезапусков, то фейлимся
403
403
if ( modelHasErrors || this . _restartCount >= this . RESTART_LIMIT ) {
404
- this . log ( 'update has models' , this . _restartCount , models ) ;
404
+ this . log ( 'update has bad models' , this . _restartCount , models ) ;
405
405
// имитируем ошибку "Невалидные модели"
406
406
var promise = this . _onRequestModelsError ( models ) ;
407
407
// делаем это синхронно
408
408
if ( promise . isFulfilled ( ) ) {
409
+ ns . log . info ( 'ns.Update.error-content' , {
410
+ _restartCount : this . _restartCount
411
+ } , models . invalid ) ;
409
412
// если ns.Update.handleError решит, что все ок, то запускаем обновление DOM
410
413
return this . _updateDOM ( ) ;
411
414
417
420
// если модели невалидные, но в них нет ошибок, то пробуем перезапуститься
418
421
this . _restartCount ++ ;
419
422
this . log ( 'restart request models' , this . _restartCount ) ;
423
+ ns . log . info ( 'ns.Update.restart' , {
424
+ _restartCount : this . _restartCount
425
+ } , models . invalid ) ;
420
426
return this . _requestModels ( this . _models )
421
427
. then ( this . _startUpdateDOM , null , this ) ;
422
428
}
Original file line number Diff line number Diff line change 875
875
ns . View . prototype . _getModelsForTree = function ( ) {
876
876
var modelsData = { } ;
877
877
878
+ var invalidModels = [ ] ;
878
879
var models = this . models ;
879
880
for ( var id in models ) {
880
881
/** @type ns.Model */
890
891
modelsData [ id ] . status = 'error' ;
891
892
// structure for convenient matching
892
893
modelsData [ id ] [ id ] = model . getError ( ) ;
894
+
895
+ invalidModels . push ( model ) ;
893
896
}
894
897
}
895
898
899
+ if ( invalidModels . length ) {
900
+ ns . log . info ( 'ns.View.error-content' , {
901
+ id : this . id ,
902
+ key : this . key
903
+ } , invalidModels ) ;
904
+ }
905
+
896
906
return modelsData ;
897
907
} ;
898
908
You can’t perform that action at this time.
0 commit comments