question: void visitAttemptRecover ( AttemptBlock attemptBlock , TemplateElement attemptedSection , RecoveryBlock recoverySection ) throws TemplateException , IOException { Writer prevOut = this . out ; StringWriter sw = new StringWriter ( ) ; this . out = sw ; TemplateException thrownException = null ; boolean lastFIRE = setFastInvalidReferenceExceptions ( false ) ; boolean lastInAttemptBlock = inAttemptBlock ; try { inAttemptBlock = true ; visit ( attemptedSection ) ; } catch ( TemplateException te ) { thrownException = te ; } finally { inAttemptBlock = lastInAttemptBlock ; setFastInvalidReferenceExceptions ( lastFIRE ) ; this . out = prevOut ; } if ( thrownException != null ) { if ( ATTEMPT_LOGGER . isDebugEnabled ( ) ) { ATTEMPT_LOGGER . debug ( "Error in attempt block " + attemptBlock . getStartLocationQuoted ( ) , thrownException ) ; } try { recoveredErrorStack . add ( thrownException ) ; visit ( recoverySection ) ; } finally { recoveredErrorStack . remove ( recoveredErrorStack . size ( ) - 1 ) ; } } else { out . write ( sw . toString ( ) ) ; } }
target:  Visit a block using buffering/recovery