File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -830,7 +830,11 @@ const createResource = (
830830 schema : OpenapiSchema ,
831831 routes : Route [ ] ,
832832) : Resource => {
833- const routePath = validateRoutePath ( schema [ 'x-route-path' ] , routes )
833+ const routePath = validateRoutePath (
834+ schemaName ,
835+ schema [ 'x-route-path' ] ,
836+ routes ,
837+ )
834838
835839 return {
836840 resourceType : schemaName ,
@@ -847,11 +851,12 @@ const createResource = (
847851}
848852
849853const validateRoutePath = (
854+ resourceName : string ,
850855 routePath : string | undefined ,
851856 routes : Route [ ] ,
852857) : string => {
853858 if ( routePath == null || routePath . length === 0 ) {
854- throw new Error ( 'Missing route path' )
859+ throw new Error ( `Resource ${ resourceName } is missing a route path` )
855860 }
856861 if ( ! routes . some ( ( r ) => r . path === routePath ) ) {
857862 throw new Error ( `Route path ${ routePath } not found in routes` )
You can’t perform that action at this time.
0 commit comments