Merge pull request 'map_err and bind_lwt_err will be deprecated with lwt.5.6.0' (#124) from upgrade-to-lwt-5.6.0 into main
Reviewed-on: https://git.robur.io/robur/builder-web/pulls/124
This commit is contained in:
commit
af0bb71ee0
3 changed files with 4 additions and 4 deletions
|
@ -22,7 +22,7 @@ depends: [
|
|||
"cstruct" {>= "6.0.0"}
|
||||
"bos"
|
||||
"hex"
|
||||
"lwt" {>= "5.3.0"}
|
||||
"lwt" {>= "5.6.0"}
|
||||
"caqti" {>= "1.8.0"}
|
||||
"caqti-lwt"
|
||||
"caqti-driver-sqlite3"
|
||||
|
|
|
@ -240,7 +240,7 @@ module Viz_aux = struct
|
|||
(Fpath.to_string viz_path)
|
||||
Lwt_io.read
|
||||
)
|
||||
|> Lwt_result.map_err (fun exn -> `Msg (Printexc.to_string exn))
|
||||
|> Lwt_result.map_error (fun exn -> `Msg (Printexc.to_string exn))
|
||||
|> if_error "Error getting cached visualization"
|
||||
|
||||
end
|
||||
|
|
|
@ -315,7 +315,7 @@ let add_build
|
|||
let job_name = job.Builder.name in
|
||||
let staging_dir = Fpath.(staging datadir / Uuidm.to_string uuid) in
|
||||
let or_cleanup x =
|
||||
Lwt_result.map_err (fun e ->
|
||||
Lwt_result.map_error (fun e ->
|
||||
Bos.OS.Dir.delete ~recurse:true staging_dir
|
||||
|> Result.iter_error (fun e ->
|
||||
Log.err (fun m -> m "Failed to remove staging dir %a: %a"
|
||||
|
@ -405,7 +405,7 @@ let add_build
|
|||
commit_files datadir staging_dir job_name uuid >|= fun () ->
|
||||
main_binary
|
||||
in
|
||||
Lwt_result.bind_lwt_err (or_cleanup r)
|
||||
Lwt_result.bind_lwt_error (or_cleanup r)
|
||||
(fun e ->
|
||||
Db.rollback ()
|
||||
|> Lwt.map (fun r ->
|
||||
|
|
Loading…
Reference in a new issue