File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
src/app/domain-annotations Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ namespace DomainAnnotations {
28
28
return ! ! model && Model . hasPdbId ( model ) ;
29
29
}
30
30
31
- export function fromJson ( model : Model , data : any ) {
31
+ export function fromJson ( model : Model , data : any ) : DomainAnnotations {
32
32
const info = PropertyWrapper . createInfo ( ) ;
33
33
const domainMap = createdomainMapFromJson ( model , data ) ;
34
34
return { info, data : domainMap } ;
@@ -88,7 +88,12 @@ export const DomainAnnotationsProvider: CustomModelProperty.Provider<DomainAnnot
88
88
isApplicable : ( data : Model ) => DomainAnnotations . isApplicable ( data ) ,
89
89
obtain : async ( ctx : CustomProperty . Context , data : Model , props : Partial < DomainAnnotationsProps > ) => {
90
90
const p = { ...PD . getDefaultValues ( DomainAnnotationsParams ) , ...props } ;
91
- return await DomainAnnotations . fromServer ( ctx , data , p ) ;
91
+ try {
92
+ return await DomainAnnotations . fromServer ( ctx , data , p ) ;
93
+ } catch {
94
+ console . error ( 'Could not obtain domain annotations' ) ;
95
+ return { value : DomainAnnotations . fromJson ( data , { } ) } ;
96
+ }
92
97
} ,
93
98
} ) ;
94
99
You can’t perform that action at this time.
0 commit comments