File tree Expand file tree Collapse file tree 3 files changed +18
-5
lines changed Expand file tree Collapse file tree 3 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,8 @@ component {
18
18
// create your FW/1 application:
19
19
request ._framework_one = new framework .one ( {
20
20
trace = true ,
21
- base = getDirectoryFromPath ( CGI .SCRIPT_NAME )
21
+ missingview = ' main.missingview' ,
22
+ base = getDirectoryFromPath ( CGI .SCRIPT_NAME )
22
23
.replaceFirst ( getContextRoot (), ' ' ) & ' introduction'
23
24
} );
24
25
Original file line number Diff line number Diff line change @@ -742,14 +742,24 @@ component {
742
742
}
743
743
// setup the new controller action, based on the error action:
744
744
request ._fw1 .controllers = [ ];
745
-
746
- if ( structKeyExists ( variables , ' framework' ) && structKeyExists ( variables .framework , ' error' ) ) {
747
- request .action = variables .framework .error ;
745
+ var key = ' error' ;
746
+ var defaultAction = ' main.error' ;
747
+ try {
748
+ if ( exception .type == ' fw1.viewnotfound' && structKeyExists ( variables .framework , ' missingview' ) ) {
749
+ key = ' missingview' ;
750
+ // shouldn't be needed -- key will be present in framework config
751
+ defaultAction = ' main.missingview' ;
752
+ }
753
+ } catch ( any e ) {
754
+ // leave it as exception
755
+ }
756
+ if ( structKeyExists ( variables , ' framework' ) && structKeyExists ( variables .framework , key ) ) {
757
+ request .action = variables .framework [ key ];
748
758
} else {
749
759
// this is an edge case so we don't bother with subsystems etc
750
760
// (because if part of the framework defaults are not present,
751
761
// we'd have to do a lot of conditional logic here!)
752
- request .action = ' main.error ' ;
762
+ request .action = defaultAction ;
753
763
}
754
764
// ensure request.context is available
755
765
if ( ! structKeyExists ( request , ' context' ) ) {
Original file line number Diff line number Diff line change
1
+ I'm sorry, but no such view is available!
2
+ <cfdump var =" #request #" />
You can’t perform that action at this time.
0 commit comments