@@ -108,13 +108,27 @@ export const recreateEvaluationQuestions = async (
108108 return ;
109109 }
110110
111- await evaluationQuestionService . resetEvaluationQuestions (
112- chainId ,
113- alloPoolId ,
114- evaluationQuestions
111+ const [ errorReset ] = await catchError (
112+ evaluationQuestionService . resetEvaluationQuestions (
113+ chainId ,
114+ alloPoolId ,
115+ evaluationQuestions
116+ )
115117 ) ;
116118
117- await evaluationService . cleanEvaluations ( ) ;
119+ if ( errorReset !== undefined ) {
120+ logger . error ( 'Failed to reset evaluation questions' , { errorReset } ) ;
121+ res . status ( 500 ) . json ( { message : 'Failed to reset evaluation questions' } ) ;
122+ return ;
123+ }
124+
125+ const [ errorClean ] = await catchError ( evaluationService . cleanEvaluations ( ) ) ;
126+
127+ if ( errorClean !== undefined ) {
128+ logger . error ( 'Failed to clean evaluations' , { errorClean } ) ;
129+ res . status ( 500 ) . json ( { message : 'Failed to clean evaluations' } ) ;
130+ return ;
131+ }
118132
119133 res . status ( 200 ) . json ( evaluationQuestions ) ;
120134} ;
@@ -150,14 +164,16 @@ export const evaluateApplication = async (
150164 summaryInput,
151165 } ;
152166
153- const isAllowed = await isPoolManager < CreateEvaluationParams > (
154- createEvaluationParams ,
155- signature ,
156- chainId ,
157- alloPoolId
167+ const [ isAllowedError , isAllowed ] = await catchError (
168+ isPoolManager < CreateEvaluationParams > (
169+ createEvaluationParams ,
170+ signature ,
171+ chainId ,
172+ alloPoolId
173+ )
158174 ) ;
159175
160- if ( ! isAllowed ) {
176+ if ( isAllowedError !== undefined || isAllowed === undefined ) {
161177 logger . warn (
162178 `User with address: ${ evaluator } is not allowed to evaluate application`
163179 ) ;
@@ -301,16 +317,17 @@ export const triggerLLMEvaluation = async (
301317 questions,
302318 } ;
303319
304- try {
305- await createLLMEvaluations ( [ data ] ) ;
306- res . status ( 200 ) . json ( { message : 'LLM evaluation triggered successfully' } ) ;
307- } catch ( error ) {
320+ const [ error ] = await catchError ( createLLMEvaluations ( [ data ] ) ) ;
321+ if ( error !== undefined ) {
308322 logger . error ( 'Failed to create evaluations:' , error ) ;
309323 res . status ( 500 ) . json ( {
310324 message : 'Failed to create evaluations' ,
311325 error : error . message ,
312326 } ) ;
313327 }
328+
329+ logger . info ( 'LLM evaluation triggered successfully' ) ;
330+ res . status ( 200 ) . json ( { message : 'LLM evaluation triggered successfully' } ) ;
314331} ;
315332
316333const batchPromises = < T > ( array : T [ ] , batchSize : number ) : T [ ] [ ] => {
0 commit comments