--- parser3/src/classes/op.C 2016/05/11 22:28:48 1.229 +++ parser3/src/classes/op.C 2016/09/14 14:02:21 1.231 @@ -18,7 +18,7 @@ #include "pa_vclass.h" #include "pa_charset.h" -volatile const char * IDENT_OP_C="$Id: op.C,v 1.229 2016/05/11 22:28:48 moko Exp $"; +volatile const char * IDENT_OP_C="$Id: op.C,v 1.231 2016/09/14 14:02:21 moko Exp $"; // limits @@ -168,8 +168,6 @@ static void _process(Request& r, MethodP Temp_lang temp_lang(r, String::L_PARSER_CODE); // temporary zero @main so to maybe-replace it in processed code Temp_method temp_method_main(*target_class, main_method_name, 0); - // temporary zero @auto so it wouldn't be auto-called in Request::use_buf - Temp_method temp_method_auto(*target_class, auto_method_name, 0); const String* main_alias=0; const String* file_alias=0; @@ -554,7 +552,10 @@ static Try_catch_result try_catch(Reques try { result.processed_code=body_code(r, info); } catch(const Exception& e) { + Request_context_saver throw_context(r); // remembering exception stack trace + Request::Exception_details details=r.get_details(e); + try_context.restore(); // restoring try-context for code after try and catch-code { @@ -576,8 +577,10 @@ static Try_catch_result try_catch(Reques bhandled=vhandled->as_bool(); } - if(!bhandled) + if(!bhandled){ + throw_context.restore(); // restoring exception stack trace creared by try_context.restore() rethrow; + } } return result;