@@ -84,8 +84,8 @@ let app configureBuilder =
84
84
|> AsyncResult.mapError ValidationErrors.ofList
85
85
|> AsyncResult.bind ( db.Create >> AsyncResult.mapError IOError)
86
86
|> AsyncResult.teeError ( function
87
- | IOError ( Create.DbExn e) -> logger.LogError ( " A database exception occurred when trying to get the clown." , e)
88
- | IOError ( Create.DbTimeout e) -> logger.LogWarning ( " A database timeout occurred when trying to get the clown." , e)
87
+ | IOError ( Create.DbExn e) -> logger.LogError ( " A database exception occurred when trying to create the clown." , e)
88
+ | IOError ( Create.DbTimeout e) -> logger.LogWarning ( " A database timeout occurred when trying to create the clown." , e)
89
89
| IOError ( Create.NameConflict _) | ValidationErrors _ -> ())
90
90
|> AsyncResult.foldResult
91
91
( Get.Clown.toDto >> fun clown -> Results.Created ( $" /api/clowns/{clown.Id}" , clown))
@@ -108,9 +108,9 @@ let app configureBuilder =
108
108
|> AsyncResult.mapError ValidationErrors.ofList
109
109
|> AsyncResult.bind ( db.Update >> AsyncResult.mapError IOError)
110
110
|> AsyncResult.teeError ( function
111
- | IOError ( Update.DbExn e) -> logger.LogError ( " A database exception occurred when trying to get the clown." , e)
112
- | IOError ( Update.DbTimeout e) -> logger.LogWarning ( " A database timeout occurred when trying to get the clown." , e)
113
- | IOError ( Update.NotFound _) | IOError ( Update.NameConflict _) | ValidationErrors _ -> ())
111
+ | IOError ( Update.DbExn e) -> logger.LogError ( " A database exception occurred when trying to update the clown." , e)
112
+ | IOError ( Update.DbTimeout e) -> logger.LogWarning ( " A database timeout occurred when trying to update the clown." , e)
113
+ | IOError Update.NotFound | IOError ( Update.NameConflict _) | ValidationErrors _ -> ())
114
114
|> AsyncResult.foldResult
115
115
( Get.Clown.toDto >> Results.Ok)
116
116
( function
@@ -127,8 +127,8 @@ let app configureBuilder =
127
127
] ( fun ( logger : ILogger < Program >) ( db : IDataAccess ) id ->
128
128
db.Delete id
129
129
|> AsyncResult.teeError ( function
130
- | Delete.DbExn e -> logger.LogError ( " A database exception occurred when trying to get the clowns ." , e)
131
- | Delete.DbTimeout e -> logger.LogWarning ( " A database timeout occurred when trying to get the clowns ." , e))
130
+ | Delete.DbExn e -> logger.LogError ( " A database exception occurred when trying to delete the clown ." , e)
131
+ | Delete.DbTimeout e -> logger.LogWarning ( " A database timeout occurred when trying to delete the clown ." , e))
132
132
|> AsyncResult.foldResult
133
133
Results.NoContent
134
134
( function
0 commit comments