package mssql

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Module for the general Mssql exception type Mssql_error. This lets us raise nice exception that always have their source code position, and optionally contain a query string, parameters, formatted query string, and result rows

type t = {
  1. msg : string;
  2. reraised_exn : Core_kernel.Exn.t option;
  3. here : Core_kernel.Source_code_position.t;
  4. query : string option;
  5. params : Mssql__.Db_field.t option list;
  6. formatted_query : string option;
  7. results : Row.t list list;
}
val sexp_of_t : t -> Ppx_sexp_conv_lib.Sexp.t
exception Mssql_error of t
val failwith : ?query:string -> ?params:Mssql__.Db_field.t option list -> ?formatted_query:string -> ?results:Row.t list list -> ?exn:Core_kernel.Exn.t -> ?backtrace:Core_kernel.Caml.Printexc.raw_backtrace -> Core_kernel.Source_code_position.t -> string -> _

failwith [%here] msg raises a Mssql_error with the given options and message

val failwithf : ?query:string -> ?params:Mssql__.Db_field.t option list -> ?formatted_query:string -> ?results:Row.t list list -> ?exn:Core_kernel.Exn.t -> ?backtrace:Core_kernel.Caml.Printexc.raw_backtrace -> Core_kernel.Source_code_position.t -> ('a, unit, string, _) Core_kernel.format4 -> 'a

failwithf [%here] "%..." msg raises a Mssql_error with the given options and a sprintf formatted message

val with_wrap : ?query:string -> ?params:Mssql__.Db_field.t option list -> ?formatted_query:string -> ?results:Row.t list list -> Core_kernel.Source_code_position.t -> (unit -> 'a) -> 'a

with_wrap_dblib_error [%here] f calls f and if it throws an exception, wraps the error in Mssql_error. There are special cases for if the exn thrown is already Mssql_error (we always preserve the %here and preserve the other info if not set), and for Dblib.Error (using the message directly, to make exceptions more readable -- although we also set reraised_exn so the original info is all there)

OCaml

Innovation. Community. Security.