File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
frontend/packages/pydantic-forms/src/core/hooks Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -19,13 +19,18 @@ export function useRefParser(
1919 return useSWR < PydanticFormSchemaParsed | undefined > (
2020 [ id , rawJsonSchema ] ,
2121 async ( [ , source ] ) => {
22- if ( ! source ) {
23- return undefined ;
22+ try {
23+ if ( ! source ) {
24+ return undefined ;
25+ }
26+ const parsedSchema = ( await $RefParser . dereference ( source , {
27+ mutateInputSchema : false ,
28+ } ) ) as unknown as PydanticFormSchemaParsed ;
29+ return parsedSchema ;
30+ } catch ( error ) {
31+ console . error ( error ) ;
32+ throw new Error ( 'Could not parse JSON references' ) ;
2433 }
25- const parsedSchema = ( await $RefParser . dereference ( source , {
26- mutateInputSchema : false ,
27- } ) ) as unknown as PydanticFormSchemaParsed ;
28- return parsedSchema ;
2934 } ,
3035 {
3136 fallback : { } ,
You can’t perform that action at this time.
0 commit comments