(** Error types for Lithos database operations *) type t = | IO_error of string | Invalid_database of string | Database_locked | Not_found let to_string = function | IO_error msg -> Printf.sprintf "I/O error: %s" msg | Invalid_database msg -> Printf.sprintf "Invalid database: %s" msg | Database_locked -> "Database is locked" | Not_found -> "Not found" ;; let of_unix_error err path = IO_error (Printf.sprintf "%s: %s" (Unix.error_message err) path)