File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed
packages/db/src/impl/pouch Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -136,16 +136,17 @@ async function addCard(
136136 return card ;
137137}
138138
139- export async function getCredentialledCourseConfig ( courseID : string ) {
140- const db = getCourseDB ( courseID ) ;
141- const ret = await db . get < CourseConfig > ( 'CourseConfig' ) ;
142- ret . courseID = courseID ;
143- console . log ( `Returning course config:
144-
145- ${ JSON . stringify ( ret ) }
146- ` ) ;
147-
148- return ret ;
139+ export async function getCredentialledCourseConfig ( courseID : string ) : Promise < CourseConfig > {
140+ try {
141+ const db = getCourseDB ( courseID ) ;
142+ const ret = await db . get < CourseConfig > ( 'CourseConfig' ) ;
143+ ret . courseID = courseID ;
144+ console . log ( `Returning course config: ${ JSON . stringify ( ret ) } ` ) ;
145+ return ret ;
146+ } catch ( e ) {
147+ console . error ( `Error fetching config for ${ courseID } :` , e ) ;
148+ throw e ;
149+ }
149150}
150151
151152/**
You can’t perform that action at this time.
0 commit comments