public static void report ( Saveable obj , Collection < Throwable > errors ) { StringBuilder buf = new StringBuilder ( ) ; int i = 0 ; for ( Throwable e : errors ) { if ( e instanceof ReportException ) { report ( obj , ( ( ReportException ) e ) . version ) ; } else { if ( ++ i > 1 ) buf . append ( ", " ) ; buf . append ( e . getClass ( ) . getSimpleName ( ) ) . append ( ": " ) . append ( e . getMessage ( ) ) ; } } if ( buf . length ( ) == 0 ) return ; Jenkins j = Jenkins . getInstanceOrNull ( ) ; if ( j == null ) { // Need this path, at least for unit tests, but also in case of very broken startup // Startup failed, something is very broken, so report what we can. for ( Throwable t : errors ) { LOGGER . log ( Level . WARNING , "could not read " + obj + " (and Jenkins did not start up)" , t ) ; } return ; } OldDataMonitor odm = get ( j ) ; SaveableReference ref = referTo ( obj ) ; while ( true ) { VersionRange vr = odm . data . get ( ref ) ; if ( vr != null && odm . data . replace ( ref , vr , new VersionRange ( vr , null , buf . toString ( ) ) ) ) { break ; } else if ( odm . data . putIfAbsent ( ref , new VersionRange ( null , null , buf . toString ( ) ) ) == null ) { break ; } } }
Inform monitor that some unreadable data was found while loading .