This commit is contained in:
2019-09-17 13:20:42 -04:00
parent d211d1dc34
commit bef10ce4c9
8352 changed files with 568242 additions and 51 deletions
+26
View File
@@ -0,0 +1,26 @@
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