Liking cljdoc? Tell your friends :D

active.clojure.condition

Conditions, protocol for communicating the causes of exceptions.

This provides infrastructure for building condition objects. A condition object provides information about the cause of an exception. Conditions thus form a protocol.

Clojure ex-info objects do not, by themselves, enough to form such a protocol, as they do not allow classifying an exception easily.

This condition system builds on the design of R6RS Scheme.

Condition objects are represented as specially marked ex-info objects.

One notable difference to the R6RS design is that there is no user-facing type for 'simple conditions', nor are they regular records.

Conditions, protocol for communicating the causes of exceptions.

This provides infrastructure for building *condition* objects.
A condition object provides information about the cause of an exception.
Conditions thus form a protocol.

Clojure `ex-info` objects do not, by themselves, enough to form such
a protocol, as they do not allow classifying an exception easily.

This condition system builds on the design of
[R6RS Scheme](http://www.r6rs.org/final/html/r6rs-lib/r6rs-lib-Z-H-8.html#node_sec_7.2).

Condition objects are represented as specially marked `ex-info` objects.

One notable difference to the R6RS design is that there is no user-facing type for
'simple conditions', nor are they regular records.
raw docstring

&assertionclj/s

Violation of a specific assertion.

Violation of a specific assertion.
sourceraw docstring

&conditionclj/s

Root of the condition-type hierarchy.

Root of the condition-type hierarchy.
sourceraw docstring

&errorclj/s

Error from environment, not preventable by the program.

Error from environment, not preventable by the program.
sourceraw docstring

&irritantsclj/s

Condition with objects providing more information about an exceptional situation.

irritants (objects providing more information): access via active.clojure.condition/condition-irritants

Condition with objects providing more information about an exceptional situation.

`irritants` (objects providing more information): access via [[active.clojure.condition/condition-irritants]]
sourceraw docstring

&locationclj/s

Location information about an exceptional situation

namespace (namespace of the location): access via active.clojure.condition/location-condition-namespace file (file name of the location): access via active.clojure.condition/location-condition-file line (line number of the loocation): access via active.clojure.condition/location-condition-line

Location information about an exceptional situation

`namespace` (namespace of the location): access via [[active.clojure.condition/location-condition-namespace]]
`file` (file name of the location): access via [[active.clojure.condition/location-condition-file]]
`line` (line number of the loocation): access via [[active.clojure.condition/location-condition-line]]
sourceraw docstring

&messageclj/s

Human-reaable message.

message (message text): access via active.clojure.condition/condition-message

Human-reaable message.

`message` (message text): access via [[active.clojure.condition/condition-message]]
sourceraw docstring

&seriousclj/s

Serious condition that should not be ignored.

Serious condition that should not be ignored.
sourceraw docstring

&throwableclj/s

Throwable value that's not a condition.

value (Throwable object): access via active.clojure.condition/throwable-value

Throwable value that's not a condition.

`value` (Throwable object): access via [[active.clojure.condition/throwable-value]]
sourceraw docstring

&violationclj/s

Bug in the program.

Bug in the program.
sourceraw docstring

&warningclj/s

Non-fatal warning.

Non-fatal warning.
sourceraw docstring

&whoclj/s

Information about in what entity an exceptional situation occurred.

who (name of the entity): access via active.clojure.condition/condition-who

Information about in what entity an exceptional situation occurred.

`who` (name of the entity): access via [[active.clojure.condition/condition-who]]
sourceraw docstring

->conditionclj/s

(->condition thing)

Coerce something into a condition object.

This yields thing if it's already a condition, and an [[&exception]] condition if it's not.

Coerce something into a condition object.

This yields `thing` if it's already a condition,
and an [[&exception]] condition if it's not.
source (clj)source (cljs)raw docstring

assertclj/smacro

(assert x)
(assert x message)

Evaluates expr and throws an exception if it does not evaluate to logical true.

Evaluates expr and throws an exception if it does not evaluate to
logical true.
sourceraw docstring

assertion-violationclj/s

(assertion-violation who message & irritants)

Throw an exception that signals that an assertion was violated.

This should be called when an invalid call to a procedure was made, either passing an invalid number of arguments, or passing an argument that it is not specified to handle.

The irritants arguments can be conditions, in which case they're included in the resulting condition, or non-conditions, which are included in an &irritants condition.

On Java, irritants can also include Throwable objects.

Throw an exception that signals that an assertion was violated.

This should be called when an invalid call to a procedure was made,
either passing an invalid number of arguments, or passing an argument
that it is not specified to handle.

The `irritants` arguments can be conditions, in which case they're included
in the resulting condition, or non-conditions, which are included in an
[[&irritants]] condition.

On Java, `irritants` can also include ``Throwable`` objects.
sourceraw docstring

assertion-violation?clj/s

(assertion-violation? thing)

Is object a active.clojure.condition/&assertion condition?

Is object a [[active.clojure.condition/&assertion]] condition?
sourceraw docstring

combine-conditionsclj/s

(combine-conditions & component-conditions)

Make a compound condition from constituents.

nil and false arguments are ignored.

Make a compound condition from constituents.

`nil` and `false` arguments are ignored.
sourceraw docstring

conditionclj/smacro

(condition ?base ?message & ?irritants)
source

condition-accessorclj/s

(condition-accessor type field-name)

Create an an accessor for field-name for conditions of type type.

Create an an accessor for `field-name` for conditions of type `type`.
sourceraw docstring

condition-irritantsclj/s≠

(condition-irritants &irritants)
clj

Access the irritants (objects providing more information) field from a active.clojure.condition/&irritants condition.

Access the `irritants` (objects providing more information) field from a [[active.clojure.condition/&irritants]] condition.
cljs

Access the irritants (objects providing more information) field from a [[user/&irritants]] condition.

Access the `irritants` (objects providing more information) field from a [[user/&irritants]] condition.
sourceraw docstring

condition-messageclj/s≠

(condition-message &message)
clj

Access the message (message text) field from a active.clojure.condition/&message condition.

Access the `message` (message text) field from a [[active.clojure.condition/&message]] condition.
cljs

Access the message (message text) field from a [[user/&message]] condition.

Access the `message` (message text) field from a [[user/&message]] condition.
sourceraw docstring

condition-of-type?clj/s

(condition-of-type? type cond)

Does condition cond have type type?

Does condition `cond` have type `type`?
sourceraw docstring

condition-predicateclj/s

(condition-predicate type)

Make predicate from condition type.

Make predicate from condition type.
sourceraw docstring

condition-whoclj/s≠

(condition-who &who)
clj

Access the who (name of the entity) field from a active.clojure.condition/&who condition.

Access the `who` (name of the entity) field from a [[active.clojure.condition/&who]] condition.
cljs

Access the who (name of the entity) field from a [[user/&who]] condition.

Access the `who` (name of the entity) field from a [[user/&who]] condition.
sourceraw docstring

condition?clj/s

(condition? x)
source

ConditionComponentcljs

source

ConditionTypecljs

source

covered-condition-typesclj/s

(covered-condition-types)
source

decode-conditionclj/s

(decode-condition con)

Return a keyword describing the type, a symbol or string describing the source of the problem, an error message or nil, and a sequence of other objects describing the problem.

Valid type symbols include: :error, :assertion-violation, :violation, :serious.

Return a keyword describing the type,
a symbol or string describing the source of the problem, an error
message or nil, and a sequence of other objects describing the
problem.

Valid type symbols include: `:error`, `:assertion-violation`,
`:violation`, `:serious`.
sourceraw docstring

define-condition-typeclj/smacro

(define-condition-type ?condition-type
                       ?supertype
                       ?constructor
                       ?predicate
                       &
                       ?field-specs)
(define-condition-type <condition-type>
  <supertype>
  <constructor> <predicate>
  [<field> <accessor> ...)

<Condition-type>, <supertype>, <constructor>, and <predicate> must all be identifiers. Each <field> and <accessor> must be identifiers.

The define-condition-type form defines a condition type named <condition-type>. It will have <supertype> has its parent type. The remaining identifiers will be bound as follows:

<Constructor> is bound to a constructor for the type: It accepts one argument for each of the condition type's complete set of fields (including parent types, with the fields of the parent coming before those of the extension in the arguments) and returns a condition object initialized to those arguments.

<Predicate> is bound to a predicate that identifies conditions of type <condition-type> or any of its subtypes.

Each <accessor> is bound to a function that extracts the corresponding field from a condition of type <condition-type>.

:doc properties attached to the metadata of <condition-type> and `the <field>s will yield proper docstrings for the names defined by this form.

    (define-condition-type <condition-type>
      <supertype>
      <constructor> <predicate>
      [<field> <accessor> ...)

`<Condition-type>`, `<supertype>`, `<constructor>`, and
`<predicate>` must all be identifiers. Each `<field>` and `<accessor>`
must be identifiers.

The `define-condition-type` form defines a condition type named
`<condition-type>`.  It will have <supertype> has its parent type. The
remaining identifiers will be bound as follows:

`<Constructor>` is bound to a constructor for the type: It accepts
one argument for each of the condition type's complete set of fields
(including parent types, with the fields of the parent coming before
those of the extension in the arguments) and returns a condition
object initialized to those arguments.

`<Predicate>` is bound to a predicate that identifies conditions of
type `<condition-type>` or any of its subtypes.

Each `<accessor>` is bound to a function that extracts the
corresponding field from a condition of type `<condition-type>`.

`:doc` properties attached to the metadata of `<condition-type>` and
`the <field>s will yield proper docstrings for the names defined by this form.
sourceraw docstring

delete-firstclj/s

(delete-first pred? l)
source

errorclj/s

(error who message & irritants)

Throw an exception that signals that an error has occurred.

This function should be called when an error has occurred, typically caused by something that has gone wrong in the interaction of the program with the external world or the user.

The irritants arguments can be conditions, in which case they're included in the resulting condition, or non-conditions, which are included in an &irritants condition.

Throw an exception that signals that an error has occurred.

This function should be called when an error has occurred,
typically caused by something that has gone wrong in the interaction
of the program with the external world or the user.

The `irritants` arguments can be conditions, in which case they're included
in the resulting condition, or non-conditions, which are included in an
[[&irritants]] condition.
sourceraw docstring

Errorcljs

source

error?clj/s

(error? thing)

Is object a active.clojure.condition/&error condition?

Is object a [[active.clojure.condition/&error]] condition?
sourceraw docstring

guardclj/smacro

(guard ?handling & ?body)
source

index-ofcljs

(index-of coll v)
source

irritants-condition?clj/s

(irritants-condition? thing)

Is object a active.clojure.condition/&irritants condition?

Is object a [[active.clojure.condition/&irritants]] condition?
sourceraw docstring

location-condition-fileclj/s≠

(location-condition-file &location)
clj

Access the file (file name of the location) field from a active.clojure.condition/&location condition.

Access the `file` (file name of the location) field from a [[active.clojure.condition/&location]] condition.
cljs

Access the file (file name of the location) field from a [[user/&location]] condition.

Access the `file` (file name of the location) field from a [[user/&location]] condition.
sourceraw docstring

location-condition-lineclj/s≠

(location-condition-line &location)
clj

Access the line (line number of the loocation) field from a active.clojure.condition/&location condition.

Access the `line` (line number of the loocation) field from a [[active.clojure.condition/&location]] condition.
cljs

Access the line (line number of the loocation) field from a [[user/&location]] condition.

Access the `line` (line number of the loocation) field from a [[user/&location]] condition.
sourceraw docstring

location-condition-namespaceclj/s≠

(location-condition-namespace &location)
clj

Access the namespace (namespace of the location) field from a active.clojure.condition/&location condition.

Access the `namespace` (namespace of the location) field from a [[active.clojure.condition/&location]] condition.
cljs

Access the namespace (namespace of the location) field from a [[user/&location]] condition.

Access the `namespace` (namespace of the location) field from a [[user/&location]] condition.
sourceraw docstring

location-condition?clj/s

(location-condition? thing)

Is object a active.clojure.condition/&location condition?

Is object a [[active.clojure.condition/&location]] condition?
sourceraw docstring

make-assertion-violationclj/s

Construct a active.clojure.condition/&assertion condition.

Construct a [[active.clojure.condition/&assertion]] condition.
sourceraw docstring

make-conditionclj/s

(make-condition condition-components)

Make a condition from components.

For internal use only.

Make a condition from components.

For internal use only.
sourceraw docstring

make-errorclj/s

Construct a active.clojure.condition/&error condition.

Construct a [[active.clojure.condition/&error]] condition.
sourceraw docstring

make-irritants-conditionclj/s

Construct a active.clojure.condition/&irritants condition.

Construct a [[active.clojure.condition/&irritants]] condition.
sourceraw docstring

make-location-conditionclj/s

Construct a active.clojure.condition/&location condition.

Construct a [[active.clojure.condition/&location]] condition.
sourceraw docstring

make-message-conditionclj/s

Construct a active.clojure.condition/&message condition.

Construct a [[active.clojure.condition/&message]] condition.
sourceraw docstring

make-serious-conditionclj/s

Construct a active.clojure.condition/&serious condition.

Construct a [[active.clojure.condition/&serious]] condition.
sourceraw docstring

make-throwableclj/s

Construct a active.clojure.condition/&throwable condition.

Construct a [[active.clojure.condition/&throwable]] condition.
sourceraw docstring

make-violationclj/s

Construct a active.clojure.condition/&violation condition.

Construct a [[active.clojure.condition/&violation]] condition.
sourceraw docstring

make-warningclj/s

Construct a active.clojure.condition/&warning condition.

Construct a [[active.clojure.condition/&warning]] condition.
sourceraw docstring

make-who-conditionclj/s

Construct a active.clojure.condition/&who condition.

Construct a [[active.clojure.condition/&who]] condition.
sourceraw docstring

message-condition?clj/s

(message-condition? thing)

Is object a active.clojure.condition/&message condition?

Is object a [[active.clojure.condition/&message]] condition?
sourceraw docstring

clj
(print-condition c w)
cljs
(print-condition c)
source (clj)source (cljs)

(print-stack-trace-of writer exception)
source

raiseclj/smacro

(raise ?base ?message & ?irritants)
source

serious-condition?clj/s

(serious-condition? thing)

Is object a active.clojure.condition/&serious condition?

Is object a [[active.clojure.condition/&serious]] condition?
sourceraw docstring

stack-trace-whoclj

(stack-trace-who st)

Get a suitable argument for &who from an exception object.

Get a suitable argument for [[&who]] from an exception object.
sourceraw docstring

throw-conditionclj/smacro

(throw-condition ?base ?who ?message ?irritants)

Throw a condition.

For internal use.

Throw a condition.

For internal use.
sourceraw docstring

Throwablecljs

source

throwable-valueclj/s≠

(throwable-value &throwable)
clj

Access the value (Throwable object) field from a active.clojure.condition/&throwable condition.

Access the `value` (Throwable object) field from a [[active.clojure.condition/&throwable]] condition.
cljs

Access the value (Throwable object) field from a [[user/&throwable]] condition.

Access the `value` (Throwable object) field from a [[user/&throwable]] condition.
sourceraw docstring

throwable?clj/s

(throwable? thing)

Is object a active.clojure.condition/&throwable condition?

Is object a [[active.clojure.condition/&throwable]] condition?
sourceraw docstring

violation?clj/s

(violation? thing)

Is object a active.clojure.condition/&violation condition?

Is object a [[active.clojure.condition/&violation]] condition?
sourceraw docstring

warning?clj/s

(warning? thing)

Is object a active.clojure.condition/&warning condition?

Is object a [[active.clojure.condition/&warning]] condition?
sourceraw docstring

who-condition?clj/s

(who-condition? thing)

Is object a active.clojure.condition/&who condition?

Is object a [[active.clojure.condition/&who]] condition?
sourceraw docstring

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

× close