@@ -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 ) ;
@@ -297,16 +313,17 @@ export const triggerLLMEvaluation = async (
297313 questions,
298314 } ;
299315
300- try {
301- await createLLMEvaluations ( [ data ] ) ;
302- res . status ( 200 ) . json ( { message : 'LLM evaluation triggered successfully' } ) ;
303- } catch ( error ) {
316+ const [ error ] = await catchError ( createLLMEvaluations ( [ data ] ) ) ;
317+ if ( error !== undefined ) {
304318 logger . error ( 'Failed to create evaluations:' , error ) ;
305319 res . status ( 500 ) . json ( {
306320 message : 'Failed to create evaluations' ,
307321 error : error . message ,
308322 } ) ;
309323 }
324+
325+ logger . info ( 'LLM evaluation triggered successfully' ) ;
326+ res . status ( 200 ) . json ( { message : 'LLM evaluation triggered successfully' } ) ;
310327} ;
311328
312329const batchPromises = < T > ( array : T [ ] , batchSize : number ) : T [ ] [ ] => {
0 commit comments