@@ -108,27 +108,13 @@ export const recreateEvaluationQuestions = async (
108108 return ;
109109 }
110110
111- const [ errorReset ] = await catchError (
112- evaluationQuestionService . resetEvaluationQuestions (
113- chainId ,
114- alloPoolId ,
115- evaluationQuestions
116- )
111+ await evaluationQuestionService . resetEvaluationQuestions (
112+ chainId ,
113+ alloPoolId ,
114+ evaluationQuestions
117115 ) ;
118116
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- }
117+ await evaluationService . cleanEvaluations ( ) ;
132118
133119 res . status ( 200 ) . json ( evaluationQuestions ) ;
134120} ;
@@ -164,16 +150,14 @@ export const evaluateApplication = async (
164150 summaryInput,
165151 } ;
166152
167- const [ isAllowedError , isAllowed ] = await catchError (
168- isPoolManager < CreateEvaluationParams > (
169- createEvaluationParams ,
170- signature ,
171- chainId ,
172- alloPoolId
173- )
153+ const isAllowed = await isPoolManager < CreateEvaluationParams > (
154+ createEvaluationParams ,
155+ signature ,
156+ chainId ,
157+ alloPoolId
174158 ) ;
175159
176- if ( isAllowedError !== undefined || isAllowed === undefined ) {
160+ if ( ! isAllowed ) {
177161 logger . warn (
178162 `User with address: ${ evaluator } is not allowed to evaluate application`
179163 ) ;
@@ -317,17 +301,16 @@ export const triggerLLMEvaluation = async (
317301 questions,
318302 } ;
319303
320- const [ error ] = await catchError ( createLLMEvaluations ( [ data ] ) ) ;
321- if ( error !== undefined ) {
304+ try {
305+ await createLLMEvaluations ( [ data ] ) ;
306+ res . status ( 200 ) . json ( { message : 'LLM evaluation triggered successfully' } ) ;
307+ } catch ( error ) {
322308 logger . error ( 'Failed to create evaluations:' , error ) ;
323309 res . status ( 500 ) . json ( {
324310 message : 'Failed to create evaluations' ,
325311 error : error . message ,
326312 } ) ;
327313 }
328-
329- logger . info ( 'LLM evaluation triggered successfully' ) ;
330- res . status ( 200 ) . json ( { message : 'LLM evaluation triggered successfully' } ) ;
331314} ;
332315
333316const batchPromises = < T > ( array : T [ ] , batchSize : number ) : T [ ] [ ] => {
0 commit comments