package pyml

  1. Overview
  2. Docs
type t =
  1. | Exception
  2. | StandardError
  3. | ArithmeticError
  4. | LookupError
  5. | AssertionError
  6. | AttributeError
  7. | EOFError
  8. | EnvironmentError
  9. | FloatingPointError
  10. | IOError
  11. | ImportError
  12. | IndexError
  13. | KeyError
  14. | KeyboardInterrupt
  15. | MemoryError
  16. | NameError
  17. | NotImplementedError
  18. | OSError
  19. | OverflowError
  20. | ReferenceError
  21. | RuntimeError
  22. | SyntaxError
  23. | SystemExit
  24. | TypeError
  25. | ValueError
  26. | ZeroDivisionError
  27. | StopIteration
val clear : unit -> unit

Wrapper for PyErr_Clear

val exception_matches : Object.t -> bool
val fetch : unit -> (Object.t * Object.t * Object.t) option

Wrapper for PyErr_Fetch.

val fetched : unit -> (Object.t * Object.t * Object.t) option

Exception fetched when Py.E has been raised.

val given_exception_matches : Object.t -> Object.t -> bool
val occurred : unit -> Object.t option

Wrapper for PyErr_Occurred

val print : unit -> unit

Wrapper for PyErr_Print

val print_ex : int -> unit

Wrapper for PyErr_PrintEx

val restore : Object.t -> Object.t -> Object.t -> unit

Wrapper for PyErr_Restore

val restore_tuple : (Object.t * Object.t * Object.t) -> unit

restore_tuple (ptype, pvalue, ptraceback) is equivalent to Py.Err.restore ptype pvalue ptraceback.

val restore_fetch : unit -> unit

Restore the exception returned by Py.Err.fetch () and raise Failure if None.

val restore_fetched : unit -> unit

Restore the exception returned by Py.Err.fetched () and raise Failure if None.

val set_error : t -> string -> unit

set_error e msg calls Py.Err.set_string e msg with a predefined error type. In a closure/method/callback, it is recommended to raise a Py.Err _ exception instead.

val set_none : Object.t -> unit

Wrapper for PyErr_SetNone

val set_string : Object.t -> string -> unit

Wrapper for PyErr_SetString

val set_object : Object.t -> Object.t -> unit

Wrapper for PyErr_SetObject. In a closure/method/callback, it is recommended to raise a Py.E _ exception instead.

val set_interrupt : unit -> unit

Wrapper for PyErr_SetInterrupt

val set_interrupt_ex : int -> unit

Since Python 3.10. Wrapper for PyErr_SetInterruptEx

OCaml

Innovation. Community. Security.