File tree Expand file tree Collapse file tree 1 file changed +18
-8
lines changed
Expand file tree Collapse file tree 1 file changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import fireQuery from "./fireQuery";
22import getDiscourseNodes from "./getDiscourseNodes" ;
33import getDiscourseRelations from "./getDiscourseRelations" ;
44import type { DiscourseRelation } from "./getDiscourseRelations" ;
5+ import internalError from "./internalError" ;
56
67// lifted from getExportTypes
78
@@ -39,14 +40,23 @@ export const getRelationDataUtil = async (
3940 label : "target" ,
4041 } ,
4142 ] ,
42- } ) . then ( ( results ) =>
43- results . map ( ( result ) => ( {
44- source : result . uid ,
45- target : result [ "target-uid" ] ,
46- relUid : s . id ,
47- label : s . label ,
48- } ) ) ,
49- ) ;
43+ } )
44+ . then ( ( results ) =>
45+ results . map ( ( result ) => ( {
46+ source : result . uid ,
47+ target : result [ "target-uid" ] ,
48+ relUid : s . id ,
49+ label : s . label ,
50+ } ) ) ,
51+ )
52+ . catch ( ( error ) => {
53+ internalError ( {
54+ error,
55+ type : "Get relation data" ,
56+ userMessage : `Could not find relations of type ${ s . label } ` ,
57+ } ) ;
58+ return [ ] ;
59+ } ) ;
5060 } ) ,
5161 ) . then ( ( r ) => r . flat ( ) ) ;
5262
You can’t perform that action at this time.
0 commit comments