@@ -202,13 +202,15 @@ async def get_workspace_alerts(workspace_name: str) -> List[Optional[v1_models.A
202
202
except crud .WorkspaceDoesNotExistError :
203
203
raise HTTPException (status_code = 404 , detail = "Workspace does not exist" )
204
204
except Exception :
205
+ logger .exception ("Error while getting workspace" )
205
206
raise HTTPException (status_code = 500 , detail = "Internal server error" )
206
207
207
208
try :
208
- alerts = await dbreader .get_alerts_with_prompt_and_output (ws .id )
209
+ alerts = await dbreader .get_alerts_by_workspace (ws .id )
209
210
prompts_outputs = await dbreader .get_prompts_with_output (ws .id )
210
211
return await v1_processing .parse_get_alert_conversation (alerts , prompts_outputs )
211
212
except Exception :
213
+ logger .exception ("Error while getting alerts and messages" )
212
214
raise HTTPException (status_code = 500 , detail = "Internal server error" )
213
215
214
216
@@ -224,13 +226,15 @@ async def get_workspace_messages(workspace_name: str) -> List[v1_models.Conversa
224
226
except crud .WorkspaceDoesNotExistError :
225
227
raise HTTPException (status_code = 404 , detail = "Workspace does not exist" )
226
228
except Exception :
229
+ logger .exception ("Error while getting workspace" )
227
230
raise HTTPException (status_code = 500 , detail = "Internal server error" )
228
231
229
232
try :
230
233
prompts_outputs = await dbreader .get_prompts_with_output (ws .id )
231
234
conversations , _ = await v1_processing .parse_messages_in_conversations (prompts_outputs )
232
235
return conversations
233
236
except Exception :
237
+ logger .exception ("Error while getting messages" )
234
238
raise HTTPException (status_code = 500 , detail = "Internal server error" )
235
239
236
240
0 commit comments