--- parser3/src/classes/op.C 2026/09/25 17:03:52 1.283 +++ parser3/src/classes/op.C 2026/09/26 19:06:55 1.285 @@ -23,7 +23,7 @@ #include "syslog.h" #endif -volatile const char * IDENT_OP_C="$Id: op.C,v 1.283 2026/09/25 17:03:52 moko Exp $"; +volatile const char * IDENT_OP_C="$Id: op.C,v 1.285 2026/09/26 19:06:55 moko Exp $"; // defines @@ -548,6 +548,8 @@ static Try_catch_result try_catch(Reques try { result.processed_code=body_code(r, info); + } catch(const Recursion_limit_exception&) { + rethrow; } catch(const Exception& e) { size_t trace_bottom=r.exception_trace.bottom_index(); size_t trace_top=r.exception_trace.top_index(); @@ -555,6 +557,7 @@ static Try_catch_result try_catch(Reques VException& details=*new VException(r, e); try_context.restore(); // restoring try-context for catch code + r.recursion_limit_try_restore(); // here to allow "endless" recursion in catch r.exception_trace.set_bottom_index(trace_top); // keep the original trace occupied; errors in catch start after it @@ -576,8 +579,8 @@ static Try_catch_result try_catch(Reques bhandled=vhandled->as_bool(); } } catch(...) { - // restore execution for finally, but keep new error trace. - try_context.restore(); + try_context.restore(); // restore execution for finally, but keep new error trace. + r.recursion_limit_try_restore(); // here to allow "endless" recursion in finally details.expire_trace(); rethrow; } @@ -587,6 +590,7 @@ static Try_catch_result try_catch(Reques r.exception_trace.set_range(trace_bottom, trace_top); rethrow; } + r.exception_trace.set_range(trace_start, trace_start); } @@ -841,6 +845,8 @@ static void _try_operator(Request& r, Me try{ // process try and catch code result=try_catch(r, process_try_body_code, &body_code, &catch_code); + } catch(const Recursion_limit_exception&) { + rethrow; } catch(...){ // process finally code but ignore the result if(finally_code){