Opal-Estate-Pro/node_modules/error/docs.mli

27 lines
485 B
OCaml
Raw Normal View History

2019-09-13 06:27:52 +02:00
type OptionError<T> := {
option: T | null,
message: String,
type: "OptionError"
}
type TypedError<T> := {
message: String,
type: T
}
type ValidationError := {
errors: Array<Error>,
message: String,
type: "ValidationError"
}
error/option := (String, T) => OptionError<T>
error/typed := (args: {
message: String,
type: String,
name?: String
}) => (opts: Object) => TypedError<String>
error/validation := (Array<Error>) => ValidationError