Previous: , Up: stdlib exceptions conditions   [Index]


5.7.2.2 Standard condition types

Hierarchy of standard condition types:

&condition
   |
   +-----> &warning
   |
   +-----> &message
   |       &irritants
   |       &who
   |
   +-----> &serious
              |
              +-----> &error
              |
              +-----> &violation
                         |
                         +-----> &assertion
                         |
                         +-----> &non-continuable
                         |
                         +-----> &implementation-restriction
                         |
                         +-----> &lexical
                         |
                         +-----> &syntax
                         |
                          -----> &undefined
Condition Type: &message
Procedure: make-message-condition message
Procedure: message-condition? obj
Procedure: condition-message condition

This condition type could be defined by:

(define-condition-type &message &condition
  make-message-condition message-condition?
  (message condition-message))

It carries a message further describing the nature of the condition to humans.

Condition Type: &warning
Procedure: make-warning
Procedure: warning? obj

This condition type could be defined by:

(define-condition-type &warning &condition
  make-warning warning?)

This type describes conditions that do not, in principle, prohibit immediate continued execution of the program, but may interfere with the program’s execution later.

Condition Type: &serious
Procedure: make-serious-condition
Procedure: serious-condition? obj

This condition type could be defined by:

(define-condition-type &serious &condition
  make-serious-condition serious-condition?)

This type describes conditions serious enough that they cannot safely be ignored. This condition type is primarily intended as a supertype of other condition types.

Condition Type: &error
Procedure: make-error
Procedure: error? obj

This condition type could be defined by:

(define-condition-type &error &serious
  make-error error?)

This type describes errors, typically caused by something that has gone wrong in the interaction of the program with the external world or the user.

Condition Type: &violation
Procedure: make-violation
Procedure: violation? obj

This condition type could be defined by:

(define-condition-type &violation &serious
  make-violation violation?)

This type describes violations of the language standard or a library standard, typically caused by a programming error.

Condition Type: &assertion
Procedure: make-assertion-violation
Procedure: assertion-violation? obj

This condition type could be defined by:

(define-condition-type &assertion &violation
  make-assertion-violation assertion-violation?)

This type describes an invalid call to a procedure, either passing an invalid number of arguments, or passing an argument of the wrong type.

Condition Type: &irritants
Procedure: make-irritants-condition irritants
Procedure: irritants-condition? obj
Procedure: condition-irritants condition

This condition type could be defined by:

(define-condition-type &irritants &condition
  make-irritants-condition irritants-condition?
  (irritants condition-irritants))

irritants should be a list of objects. This condition provides additional information about a condition, typically the argument list of a procedure that detected an exception. Conditions of this type are created by the procedures error and assertion-violation.

Condition Type: &who
Procedure: make-who-condition who
Procedure: who-condition? obj
Procedure: condition-who condition

This condition type could be defined by:

(define-condition-type &who &condition
  make-who-condition who-condition?
  (who condition-who))

who should be a symbol or string identifying the entity reporting the exception. Conditions of this type are created by the error and assertion-violation procedures (report section baselib errors), and the syntax-violation procedure (section scheme basic syntax violations).

Condition Type: &non-continuable
Procedure: make-non-continuable-violation
Procedure: non-continuable-violation? obj

This condition type could be defined by:

(define-condition-type &non-continuable &violation
  make-non-continuable-violation
  non-continuable-violation?)

This type indicates that an exception handler invoked via raise has returned.

Condition Type: &implementation-restriction
Procedure: make-implementation-restriction-violation
Procedure: implementation-restriction-violation? obj

This condition type could be defined by:

(define-condition-type &implementation-restriction
    &violation
  make-implementation-restriction-violation
  implementation-restriction-violation?)

This type describes a violation of an implementation restriction allowed by the specification, such as the absence of representations for NaNs and infinities.

Condition Type: &lexical
Procedure: make-lexical-violation
Procedure: lexical-violation? obj

This condition type could be defined by:

(define-condition-type &lexical &violation
  make-lexical-violation lexical-violation?)

This type describes syntax violations at the level of the datum syntax.

Condition Type: &syntax
Procedure: make-syntax-violation form subform
Procedure: syntax-violation? obj
Procedure: syntax-violation-form condition
Procedure: syntax-violation-subform condition

This condition type could be defined by:

(define-condition-type &syntax &violation
  make-syntax-violation syntax-violation?
  (form syntax-violation-form)
  (subform syntax-violation-subform))

This type describes syntax violations. form should be the erroneous syntax object or a datum representing the code of the erroneous form. subform should be an optional syntax object or datum within the erroneous form that more precisely locates the violation. It can be #f to indicate the absence of more precise information.

Condition Type: &undefined
Procedure: make-undefined-violation
Procedure: undefined-violation? obj

This condition type could be defined by:

(define-condition-type &undefined &violation
  make-undefined-violation undefined-violation?)

This type describes unbound identifiers in the program.


Previous: , Up: stdlib exceptions conditions   [Index]