Skip to content

Commit 42e3799

Browse files
committed
update AddUpdateAdminEvent
Related to: aliencube#203
1 parent 37efcfa commit 42e3799

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/AzureOpenAIProxy.ApiApp/Endpoints/AdminEventEndpoints.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,19 @@ public static RouteHandlerBuilder AddUpdateAdminEvent(this WebApplication app)
189189

190190
return Results.Ok(result);
191191
}
192+
catch(RequestFailedException ex)
193+
{
194+
if(ex.Status == 404)
195+
{
196+
logger.LogError($"Failed to update event details with ID: {eventId}");
197+
return Results.NotFound();
198+
}
199+
200+
logger.LogError(ex, $"Error occurred while updating event details of {eventId} with status {ex.Status}");
201+
return Results.Problem(ex.Message, statusCode: StatusCodes.Status500InternalServerError);
202+
}
192203
catch (Exception ex)
193204
{
194-
// need to add 404
195205
logger.LogError(ex, $"Failed to update event details with ID: {eventId}");
196206

197207
return Results.Problem(ex.Message, statusCode: StatusCodes.Status500InternalServerError);

0 commit comments

Comments
 (0)