@@ -8,8 +8,8 @@ public protocol Crudable: ControllerProtocol {
88 at path: PathComponentsRepresentable ... ,
99 parent relation: KeyPath < ChildType , Parent < ChildType , ParentType > > ,
1010 _ either: OnlyExceptEither < ParentRouterMethod > ,
11- relationConfiguration: ( ( CrudParentController < ChildType , ParentType > ) throws -> Void ) ?
12- ) throws where
11+ relationConfiguration: ( ( CrudParentController < ChildType , ParentType > ) -> Void ) ?
12+ ) where
1313 ParentType: Model & Content ,
1414 ChildType. Database == ParentType . Database ,
1515 ParentType. ID: Parameter
@@ -18,8 +18,8 @@ public protocol Crudable: ControllerProtocol {
1818 at path: PathComponentsRepresentable ... ,
1919 children relation: KeyPath < ChildType , Children < ChildType , ChildChildType > > ,
2020 _ either: OnlyExceptEither < ChildrenRouterMethod > ,
21- relationConfiguration: ( ( CrudChildrenController < ChildChildType , ChildType > ) throws -> Void ) ?
22- ) throws where
21+ relationConfiguration: ( ( CrudChildrenController < ChildChildType , ChildType > ) -> Void ) ?
22+ ) where
2323 ChildChildType: Model & Content ,
2424 ChildType. Database == ChildChildType . Database ,
2525 ChildChildType. ID: Parameter
@@ -28,8 +28,8 @@ public protocol Crudable: ControllerProtocol {
2828 at path: PathComponentsRepresentable ... ,
2929 siblings relation: KeyPath < ChildType , Siblings < ChildType , ChildChildType , ThroughType > > ,
3030 _ either: OnlyExceptEither < ModifiableSiblingRouterMethod > ,
31- relationConfiguration: ( ( CrudSiblingsController < ChildChildType , ChildType , ThroughType > ) throws -> Void ) ?
32- ) throws where
31+ relationConfiguration: ( ( CrudSiblingsController < ChildChildType , ChildType , ThroughType > ) -> Void ) ?
32+ ) where
3333 ChildChildType: Content ,
3434 ChildType. Database == ThroughType . Database ,
3535 ChildChildType. ID: Parameter ,
@@ -43,8 +43,8 @@ public protocol Crudable: ControllerProtocol {
4343 at path: PathComponentsRepresentable ... ,
4444 siblings relation: KeyPath < ChildType , Siblings < ChildType , ChildChildType , ThroughType > > ,
4545 _ either: OnlyExceptEither < ModifiableSiblingRouterMethod > ,
46- relationConfiguration: ( ( CrudSiblingsController < ChildChildType , ChildType , ThroughType > ) throws -> Void ) ?
47- ) throws where
46+ relationConfiguration: ( ( CrudSiblingsController < ChildChildType , ChildType , ThroughType > ) -> Void ) ?
47+ ) where
4848 ChildChildType: Content ,
4949 ChildType. Database == ThroughType . Database ,
5050 ChildChildType. ID: Parameter ,
@@ -60,8 +60,8 @@ extension Crudable {
6060 at path: PathComponentsRepresentable ... ,
6161 parent relation: KeyPath < ChildType , Parent < ChildType , ParentType > > ,
6262 _ either: OnlyExceptEither < ParentRouterMethod > = . only( [ . read, . update] ) ,
63- relationConfiguration: ( ( CrudParentController < ChildType , ParentType > ) throws -> Void ) ? = nil
64- ) throws where
63+ relationConfiguration: ( ( CrudParentController < ChildType , ParentType > ) -> Void ) ? = nil
64+ ) where
6565 ParentType: Model & Content ,
6666 ChildType. Database == ParentType . Database ,
6767 ParentType. ID: Parameter {
@@ -81,17 +81,17 @@ extension Crudable {
8181 controller = CrudParentController ( relation: relation, path: fullPath, router: self . router, activeMethods: allMethods. subtracting ( Set ( methods) ) )
8282 }
8383
84- try controller. boot ( router: self . router)
84+ do { try controller. boot ( router: self . router) } catch { fatalError ( " I have no reason to expect boot to throw " ) }
8585
86- try relationConfiguration ? ( controller)
86+ relationConfiguration ? ( controller)
8787 }
8888
8989 public func crud< ChildChildType> (
9090 at path: PathComponentsRepresentable ... ,
9191 children relation: KeyPath < ChildType , Children < ChildType , ChildChildType > > ,
9292 _ either: OnlyExceptEither < ChildrenRouterMethod > = . only( [ . read, . readAll, . create, . update, . delete] ) ,
93- relationConfiguration: ( ( CrudChildrenController < ChildChildType , ChildType > ) throws -> Void ) ? = nil
94- ) throws where
93+ relationConfiguration: ( ( CrudChildrenController < ChildChildType , ChildType > ) -> Void ) ? = nil
94+ ) where
9595 ChildChildType: Model & Content ,
9696 ChildType. Database == ChildChildType . Database ,
9797 ChildChildType. ID: Parameter {
@@ -110,17 +110,17 @@ extension Crudable {
110110 controller = CrudChildrenController < ChildChildType , ChildType > ( childrenRelation: relation, path: fullPath, router: self . router, activeMethods: allMethods. subtracting ( Set ( methods) ) )
111111 }
112112
113- try controller. boot ( router: self . router)
113+ do { try controller. boot ( router: self . router) } catch { fatalError ( " I have no reason to expect boot to throw " ) }
114114
115- try relationConfiguration ? ( controller)
115+ relationConfiguration ? ( controller)
116116 }
117117
118118 public func crud< ChildChildType, ThroughType> (
119119 at path: PathComponentsRepresentable ... ,
120120 siblings relation: KeyPath < ChildType , Siblings < ChildType , ChildChildType , ThroughType > > ,
121121 _ either: OnlyExceptEither < ModifiableSiblingRouterMethod > = . only( [ . read, . readAll, . create, . update, . delete] ) ,
122- relationConfiguration: ( ( CrudSiblingsController < ChildChildType , ChildType , ThroughType > ) throws -> Void ) ? = nil
123- ) throws where
122+ relationConfiguration: ( ( CrudSiblingsController < ChildChildType , ChildType , ThroughType > ) -> Void ) ? = nil
123+ ) where
124124 ChildChildType: Content ,
125125 ChildType. Database == ThroughType . Database ,
126126 ChildChildType. ID: Parameter ,
@@ -145,17 +145,17 @@ extension Crudable {
145145 controller = CrudSiblingsController < ChildChildType , ChildType , ThroughType > ( siblingRelation: relation, path: fullPath, router: self . router, activeMethods: allMethods. subtracting ( Set ( methods) ) )
146146 }
147147
148- try controller. boot ( router: self . router)
148+ do { try controller. boot ( router: self . router) } catch { fatalError ( " I have no reason to expect boot to throw " ) }
149149
150- try relationConfiguration ? ( controller)
150+ relationConfiguration ? ( controller)
151151 }
152152
153153 public func crud< ChildChildType, ThroughType> (
154154 at path: PathComponentsRepresentable ... ,
155155 siblings relation: KeyPath < ChildType , Siblings < ChildType , ChildChildType , ThroughType > > ,
156156 _ either: OnlyExceptEither < ModifiableSiblingRouterMethod > = . only( [ . read, . readAll, . create, . update, . delete] ) ,
157- relationConfiguration: ( ( CrudSiblingsController < ChildChildType , ChildType , ThroughType > ) throws -> Void ) ? = nil
158- ) throws where
157+ relationConfiguration: ( ( CrudSiblingsController < ChildChildType , ChildType , ThroughType > ) -> Void ) ? = nil
158+ ) where
159159 ChildChildType: Content ,
160160 ChildType. Database == ThroughType . Database ,
161161 ChildChildType. ID: Parameter ,
@@ -179,8 +179,8 @@ extension Crudable {
179179 controller = CrudSiblingsController < ChildChildType , ChildType , ThroughType > ( siblingRelation: relation, path: fullPath, router: self . router, activeMethods: allMethods. subtracting ( Set ( methods) ) )
180180 }
181181
182- try controller. boot ( router: self . router)
182+ do { try controller. boot ( router: self . router) } catch { fatalError ( " I have no reason to expect boot to throw " ) }
183183
184- try relationConfiguration ? ( controller)
184+ relationConfiguration ? ( controller)
185185 }
186186}
0 commit comments