File tree Expand file tree Collapse file tree
core/src/main/java/lucee/runtime/functions/system Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2626import lucee .runtime .config .Config ;
2727import lucee .runtime .engine .ThreadLocalPageContext ;
2828import lucee .runtime .exp .Abort ;
29+ import lucee .runtime .exp .ApplicationException ;
2930import lucee .runtime .exp .FunctionException ;
31+ import lucee .runtime .exp .RequestTimeoutException ;
3032import lucee .runtime .exp .PageException ;
3133import lucee .runtime .ext .function .Function ;
3234import lucee .runtime .functions .other .CreatePageContext ;
@@ -135,7 +137,15 @@ else if (body != null) {
135137 catch (Throwable t ) {
136138 ExceptionUtil .rethrowIfNecessary (t );
137139 if (!Abort .isSilentAbort (t )) {
138- if (throwonerror ) throw Caster .toPageException (t );
140+ if (throwonerror ) {
141+ // wrap RequestTimeoutException so it doesn't kill the parent request
142+ if (t instanceof RequestTimeoutException ) {
143+ ApplicationException ae = new ApplicationException (t .getMessage ());
144+ ae .initCause (t );
145+ throw ae ;
146+ }
147+ throw Caster .toPageException (t );
148+ }
139149 pe = Caster .toPageException (t );
140150 }
141151 }
Original file line number Diff line number Diff line change @@ -13,16 +13,21 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="internalRequest" {
1313 throwonerror : false
1414 );
1515 expect ( result ).toHaveKey ( " error" );
16- expect ( result .error .type ).toBe ( " lucee.runtime.exp.RequestTimeoutException " );
16+ expect ( result .error .message ).toInclude ( " timeout " );
1717 });
1818
19- it ( title = " InternalRequest should throw RequestTimeoutException with throwonerror=true" , body = function () {
20- expect ( function () {
19+ it ( title = " InternalRequest should throw with throwonerror=true on RequestTimeoutException " , body = function () {
20+ try {
2121 _InternalRequest (
2222 template : " #variables .uri #/timeout.cfm" ,
2323 throwonerror : true
2424 );
25- }).toThrow ( " lucee.runtime.exp.RequestTimeoutException" );
25+ fail ( " expected exception was not thrown" );
26+ }
27+ catch ( application e ) {
28+ // wrapped in ApplicationException so it doesn't kill the parent request
29+ expect ( e .message ).toInclude ( " timeout" );
30+ }
2631 });
2732
2833 });
You can’t perform that action at this time.
0 commit comments