@@ -108,27 +108,13 @@ export const recreateEvaluationQuestions = async (
108
108
return ;
109
109
}
110
110
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
117
115
) ;
118
116
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 ( ) ;
132
118
133
119
res . status ( 200 ) . json ( evaluationQuestions ) ;
134
120
} ;
@@ -164,16 +150,14 @@ export const evaluateApplication = async (
164
150
summaryInput,
165
151
} ;
166
152
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
174
158
) ;
175
159
176
- if ( isAllowedError !== undefined || isAllowed === undefined ) {
160
+ if ( ! isAllowed ) {
177
161
logger . warn (
178
162
`User with address: ${ evaluator } is not allowed to evaluate application`
179
163
) ;
@@ -317,17 +301,16 @@ export const triggerLLMEvaluation = async (
317
301
questions,
318
302
} ;
319
303
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 ) {
322
308
logger . error ( 'Failed to create evaluations:' , error ) ;
323
309
res . status ( 500 ) . json ( {
324
310
message : 'Failed to create evaluations' ,
325
311
error : error . message ,
326
312
} ) ;
327
313
}
328
-
329
- logger . info ( 'LLM evaluation triggered successfully' ) ;
330
- res . status ( 200 ) . json ( { message : 'LLM evaluation triggered successfully' } ) ;
331
314
} ;
332
315
333
316
const batchPromises = < T > ( array : T [ ] , batchSize : number ) : T [ ] [ ] => {
0 commit comments