package devkit
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
Development kit - general purpose library
Install
dune-project
Dependency
Authors
Maintainers
Sources
1.20261006.tar.gz
md5=a39dbbce04bd5562a9b4443daf39c582
sha512=b10104b61384b2151521b785e7f3c3250134c75eae09b42cad69bc4a22a9a5e429beb891ee87cedf376c23d9c40f09d3f71c3fd48aa35df490c0f69dc17f3242
doc/src/devkit.core/exn.ml.html
Source file exn.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52(** Dealing with exceptions *) open Printf open ExtLib type 'a result = [ `Ok of 'a | `Exn of exn ] let catch f x = try Some (f x) with _ -> None let default def f x = try f x with _ -> def let suppress f x = try f x with _ -> () let map f x = try `Ok (f x) with exn -> `Exn exn let to_string exn = match exn with | Unix.Unix_error (e,f,s) -> sprintf "Unix_error %s(%s) %s" f s (Unix.error_message e) | Curl.CurlException (_,n,s) -> sprintf "Curl.CurlException(%u,%s)" n s | Pcre2.Error err -> sprintf "Pcre2.Error(%s)" begin match err with | Partial -> "Partial" | BadPattern(m,p) -> sprintf "BadPattern(%s,%i)" m p | BadUTF -> "BadUTF" | BadUTFOffset -> "BadUTFOffset" | MatchLimit -> "MatchLimit" | DepthLimit -> "DepthLimit" | InternalError s -> sprintf "InternalError(%s)" s | _ -> Printexc.to_string exn end | exn -> Printexc.to_string exn let str = to_string (** The original backtrace is captured via `Printexc.get_raw_backtrace ()`. However, note that this backtrace might not correspond to the provided `exn` if another exception was raised before `fail` is called. *) let fail ?exn fmt = let fails s = match exn with | None -> failwith s | Some original_exn -> let orig_bt = Printexc.get_raw_backtrace () in let exn = Failure (s ^ " : " ^ to_string original_exn) in Printexc.raise_with_backtrace exn orig_bt in ksprintf fails fmt let invalid_arg fmt = ksprintf invalid_arg fmt let get_backtrace () = String.nsplit (Printexc.get_backtrace ()) "\n"
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>