Module Runtime_jsoo.Runtime

A js_of_ocaml wrapper around the Runtime_ocaml.Runtime.

Log events

class type source_position = object ... end

Information about the position of the log inside the Catala source file.

class type raw_event = object ... end

Wrapper for the Runtime_ocaml.Runtime.raw_event -- directly collected during the program execution.

class type event = object ... end

Wrapper for the Runtime_ocaml.Runtime.event -- structured log event parsed from the raw_event ones.

class type event_manager = object ... end
val event_manager : event_manager Js_of_ocaml.Js.t

JS object usable to retrieve and reset log events.

Duration

class type duration = object ... end

Simple JSOO wrapper around Runtime_ocaml.Runtime.duration.

val duration_of_jsoo : duration Js_of_ocaml.Js.t -> Runtime_ocaml.Runtime.duration
val duration_to_jsoo : Runtime_ocaml.Runtime.duration -> duration Js_of_ocaml.Js.t

Date conversion

Date values are encoded to a string in the ISO8601 format: 'YYYY-MM-DD'.

val date_of_jsoo : Js_of_ocaml.Js.js_string Js_of_ocaml.Js.t -> Runtime_ocaml.Runtime.date
val date_to_jsoo : Runtime_ocaml.Runtime.date -> Js_of_ocaml.Js.js_string Js_of_ocaml.Js.t

Error management

val execute_or_throw_error : ( unit -> 'a ) -> 'a

execute_or_throw_error f calls f () and propagates the Runtime_ocaml.Runtime.NoValueProvided, Runtime_ocaml.Runtime.ConflictError Runtime_ocaml.Runtime.AssertionFailed exceptions by raising a JS error if needed.