Liking cljdoc? Tell your friends :D

recide.impl


*capture-insists*clj

If true, default insist will capture the values of all lexical bindings used within the clause.

If true, default `insist` will capture the values of all lexical bindings
used within the clause.
sourceraw docstring

custom-error-map?clj

(custom-error-map? error-form x)
(custom-error-map? custom-error x type)
source

custom-error?clj

(custom-error? custom-error x)
(custom-error? custom-error x type)
source

default-error-definitionclj

source

deferror*cljmacro

(deferror* custom-error error-name type generic-str)
(deferror* custom-error error-name type generic-str required-keys)

Defines a new error constructor and a specialized version of the recide/raise macro, where the type and the 'generic' portion of the error message are static and required arguments are specified via the final sequence of key-words. Defines two macros (for compile-time errors). The first is a constructor named error-name, with the signature: ([detail-msg data] [detail-msg data cause])

Also defined is a corresponding raise- macro with the signature: ([detail-msg {:as extra-data}] [detail-msg {:as extra-data} cause]).

Example: (deferror storage-timeout :storage/timeout "A storage operation timed out" [:method])

You can use the constructor like so: (storage-timeout "A call to get-value took too long." {:method 'get-value, :nodes-count (count kvs)})

This macro would expand into the following: (error :storage/timeout (str "A storage operation timed out: " "A call to get-value took too long.") {:method 'get-value, :nodes-count (count kvs)})

Using the generated raise- macro is similar: (raise-storage-timeout "A call to get-value took too long." {:method 'get-value :nodes-count (count kvs)})

This macro would expand similarly into a raise form. In both examples, if :method were left out of the data map, an exception would be thrown at compile time.

Defines a new error constructor and a specialized version of the recide/raise macro,
where the type and the 'generic' portion of the error message are static and required
arguments are specified via the final sequence of key-words. Defines two macros (for
compile-time errors). The first is a constructor named error-name, with the signature:
([detail-msg data] [detail-msg data cause])

Also defined is a corresponding `raise-` macro with the signature:
([detail-msg {:as extra-data}]
 [detail-msg {:as extra-data} cause]).

Example:
(deferror storage-timeout
    :storage/timeout
    "A storage operation timed out"
    [:method])

You can use the constructor like so:
(storage-timeout "A call to get-value took too long."
                 {:method 'get-value,
                  :nodes-count (count kvs)})

This macro would expand into the following:
(error :storage/timeout
       (str "A storage operation timed out: "
            "A call to get-value took too long.")
       {:method 'get-value,
        :nodes-count (count kvs)})

Using the generated raise- macro is similar:
(raise-storage-timeout "A call to get-value took too long."
                       {:method 'get-value
                        :nodes-count (count kvs)})

This macro would expand similarly into a raise form. In both examples, if :method were left
out of the data map, an exception would be thrown at compile time.
sourceraw docstring

deferror-group*cljmacro

(deferror-group* custom-error error-name group-key subtypes)

Defines specialized (macro) variants of recide/error and recide/raise, for working with a namespaced family of error types. For each subtype, the 'generic' portion of the error message is static. Required data keywords can be specified for both the entire family of errors and for each subtype.

Both the constructor and raise macros have the same signature: ([subtype detail-msg {:as extra-data}] [subtype detail-msg {:as extra-data} cause]).

Example: (deferror-group parse-err (:query.invalid [:expression]) (find-spec "Invalid find spec") (inputs "Invalid inputs" [:invalid]))

An example of using the constructor is: (parse-err :inputs "Input arguments must be integers" {:expression spec, :invalid (remove input? args)})

This would expand into the following: (error :query.invalid/inputs (str "Invalid inputs" ":" "Input arguments must be integers" {:expresion spec, :invalid (remove input? args)})

To use the raise form, you would replace parse-err with raise-parse-err. In either case in this example, if either :expression or :invalid were left out of the data map, an exception would be thrown at compile time.

Defines specialized (macro) variants of recide/error and recide/raise, for working
with a namespaced family of error types. For each subtype, the 'generic' portion of the
error message is static. Required data keywords can be specified for both the entire
family of errors and for each subtype.

Both the constructor and raise macros have the same signature:
([subtype detail-msg {:as extra-data}]
 [subtype detail-msg {:as extra-data} cause]).

Example:
(deferror-group parse-err
    (:query.invalid [:expression])
    (find-spec "Invalid find spec")
    (inputs "Invalid inputs" [:invalid]))

An example of using the constructor is:
(parse-err :inputs
           "Input arguments must be integers"
           {:expression spec,
            :invalid (remove input? args)})

This would expand into the following:
(error :query.invalid/inputs
       (str "Invalid inputs"
            ":"
            "Input arguments must be integers"
       {:expresion spec, :invalid (remove input? args)})

To use the raise form, you would replace `parse-err` with `raise-parse-err`. In either case
in this example, if either :expression or :invalid were left out of the data map, an
exception would be thrown at compile time.
sourceraw docstring

errorclj

(error type msg data)
(error type msg data cause)

Returns a recide error (IExceptionInfo) with the type (keyword), msg (string), data (map), and cause (Throwable). Merges the following map onto the ex-data:

For Example: {:recide/error recide.error.ErrorForm@447521e, :recide/type type}

ErrorForm definition: recide.impl/default-error-definition

Constructor: clojure.core$ex_info

Returns a recide error (IExceptionInfo) with the type (keyword), msg (string), data (map),
and cause (Throwable). Merges the following map onto the ex-data:

For Example: `{:recide/error recide.error.ErrorForm@447521e, :recide/type type}`

ErrorForm definition: `recide.impl/default-error-definition`

Constructor: `clojure.core$ex_info`
sourceraw docstring

error*clj

(error* custom-error type msg data)
(error* custom-error type msg data cause)
source

error->mapclj

(error->map x)

Verifies that the IExceptionInfo is a recide error, then converts it to map form.

Verifies that the IExceptionInfo is a recide error, then converts it to map form.
sourceraw docstring

error->serializableclj

(error->serializable err)
source

error-mapclj

(error-map type msg data)
(error-map type msg data cause)

Returns a map representing a recide error with the type (keyword), msg (string), data map, and cause.

{recide.impl/default-error-definition type, :recide/type msg, :recide/msg data, :recide/data cause, :recide/cause <serialized-form>}

ErrorForm definition: :recide.serialized-throwable/v1 Constructor: clojure.core$ex_info

Returns a map representing a recide error with the type (keyword), msg (string), data map,
and cause.

{recide.impl/default-error-definition type,
 :recide/type msg,
 :recide/msg data,
 :recide/data cause,
 :recide/cause <serialized-form>}

ErrorForm definition: :recide.serialized-throwable/v1
Constructor: clojure.core$ex_info
sourceraw docstring

error-map*clj

(error-map* custom-error type msg data)
(error-map* custom-error type msg data cause)

Creates the map form of a recide error with the type (keyword), msg (string), data map, and cause.

Creates the map form of a recide error with the type (keyword), msg (string), data map, and cause.
sourceraw docstring

error-map->errorclj

(error-map->error err)
source

error-map->serializable-errorclj

(error-map->serializable-error err)
source

error-map->throwableclj

(error-map->throwable err)

Verifies that the map is polymorphic to a recide error, then converts it back into an IExceptionInfo. It will use the ErrorForm (and constructor) designated in the map by :recide/error.

Verifies that the map is polymorphic to a recide error, then converts it back into an IExceptionInfo.
It will use the ErrorForm (and constructor) designated in the map by :recide/error.
sourceraw docstring

error-map?clj

(error-map? x)
(error-map? x type)

Checks whether the given map constitutes a valid recide error. If a keyword type is provided, this also verifies that the error is of that type. Matches :namespace/* as a partial wildcard for error types.

Checks whether the given map constitutes a valid recide error. If a
keyword type is provided, this also verifies that the error is of that type.
Matches :namespace/* as a partial wildcard for error types.
sourceraw docstring

error-typeclj

(error-type x)

Accepts a recide error or error-map. Returns nil when it's not. Not safe for use in a custom constructor unless serialization/deserialization is out of the question.

Accepts a recide error or error-map. Returns nil when it's not. Not safe for use in
a custom constructor unless serialization/deserialization is out of the question.
sourceraw docstring

error?clj

(error? x)
(error? x type)

Checks whether the given IExceptionInfo is a recide error. If a type keyword is provided, it also checks that the error has that type.

Checks whether the given IExceptionInfo is a recide error.
If a type keyword is provided, it also checks that the error has that type.
sourceraw docstring

generate-custom-error-librarycljmacro

(generate-custom-error-library custom-error capture-flag)
source

generate-deferrorcljmacro

(generate-deferror custom-error)
source

generate-deferror*clj

(generate-deferror* custom-error)

custom-error is fully-qualified symbol.

custom-error is fully-qualified symbol.
sourceraw docstring

generate-deferror-groupcljmacro

(generate-deferror-group custom-error)
source

generate-deferror-group*clj

(generate-deferror-group* custom-error)
source

generate-errorcljmacro

(generate-error custom-error)
source

generate-error*clj

(generate-error* custom-error)
source

generate-error-mapcljmacro

(generate-error-map custom-error)
source

generate-error-map*clj

(generate-error-map* custom-error)
source

generate-error-map?cljmacro

(generate-error-map? custom-error)
source

generate-error-map?*clj

(generate-error-map?* custom-error)
source

generate-error?cljmacro

(generate-error? custom-error)
source

generate-error?*clj

(generate-error?* custom-error)
source

generate-insistcljmacro

(generate-insist capture-flag custom-error)
source

generate-raisecljmacro

(generate-raise custom-error)
source

generate-raise*clj

(generate-raise* custom-error)

custom-error must be fully-qualified symbols.

custom-error must be fully-qualified symbols.
sourceraw docstring

generate-throwable->error-mapcljmacro

(generate-throwable->error-map custom-error)
source

generate-throwable->error-map*clj

(generate-throwable->error-map* custom-error)
source

insistcljmacro

(insist expr)
(insist expr message)

Same syntax as assert. If assertion is disabled, insistence will also be disabled. Throws an IExceptionInfo if expr does not evaluate to logical true. recide.impl/default-error-definition is the constructor used.

Otherwise, it acts like recide/raise, constructing a recide error of the following form: {:recide/type :recide/assertion, :recide/msg msg, :recide/data <data>, :recide.serialized-throwable/v1 <serialized-form>}

When recide.impl/capture-insists is true, this will also capture the bindings of symbols used in the assertion, inserting these values into the data map. recide.impl/capture-insists is false by default, unless one of the following was true at class load: (1) env var is true: RECIDERE_CAPTURE_INSISTS (2) system property is set: recide.capture-insists

Same syntax as assert. If assertion is disabled, insistence will also be disabled.
Throws an IExceptionInfo if expr does not evaluate to logical true.
recide.impl/default-error-definition is the constructor used.

Otherwise, it acts like recide/raise, constructing a recide error of
the following form:
{:recide/type :recide/assertion,
 :recide/msg msg,
 :recide/data <data>,
 :recide.serialized-throwable/v1 <serialized-form>}

When recide.impl/*capture-insists* is true, this will also capture the bindings of symbols used
in the assertion, inserting these values into the data map. recide.impl/*capture-insists*
is false by default, unless one of the following was true at class load:
 (1) env var is true: RECIDERE_CAPTURE_INSISTS
 (2) system property is set: recide.capture-insists
sourceraw docstring

insist*cljmacro

(insist* capture-flag custom-error expr)
(insist* capture-flag custom-error expr message)

capture-flag, raised-sites, and custom-error must be fully-qualified symbols. Same syntax as assert. If assertion is disabled, insistence will also be disabled. Throws an exception if expr does not evaluate to logical true.

Otherwise, it acts like recide/raise, with type :recide/assertion. The bindings of symbols used in the assertion are inserted into the info map.

capture-flag, raised-sites, and custom-error must be fully-qualified symbols.
Same syntax as assert. If assertion is disabled, insistence will also be disabled.
Throws an exception if expr does not evaluate to logical true.

Otherwise, it acts like recide/raise, with type :recide/assertion. The bindings of
symbols used in the assertion are inserted into the info map.
sourceraw docstring

raisecljmacro

(raise type msg data)
(raise type msg data cause)

Records this raise-site on the ErrorForm definition, and constructs an IExceptionInfo as a recide-style error.

ErrorForm: recide.impl/default-error-definition Constructor: clojure.core$ex_info

Merges the following map onto the data: {:recide/error recide.impl/default-error-definition, :recide/type type}

Records this raise-site on the ErrorForm definition, and constructs
an IExceptionInfo as a recide-style error.

ErrorForm: recide.impl/default-error-definition
Constructor: clojure.core$ex_info

Merges the following map onto the data:
{:recide/error recide.impl/default-error-definition,
 :recide/type type}
sourceraw docstring

raise*cljmacro

(raise* custom-error type msg data)
(raise* custom-error type msg data cause)

raised-sites and custom-error are fully-qualified symbols Records this raise-site for the error type, and expands into:

(throw (error {:recide/type type, :recide/msg msg, :recide/data data, :recide/cause cause}))

raised-sites and custom-error are fully-qualified symbols
Records this raise-site for the error type, and expands into:

(throw (error {:recide/type type,
               :recide/msg msg,
               :recide/data data,
               :recide/cause cause}))
sourceraw docstring

read-string-with-default-taggingclj

source

record-raised-error-site!clj

(record-raised-error-site! custom-error err-type msg ns form)
source

throwable->error-mapclj

(throwable->error-map custom-error e)
source

var->qualified-symclj

(var->qualified-sym v)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close