;;;; standard-conditions.scm -*- Scheme -*- ;;;; Kon Lovett, Jul '18 ;;;; Kon Lovett, Jun '13 (module standard-conditions (;export ; arity-condition? type-condition? arithmetic-condition? i/o-condition? file-condition? network-condition? network-timeout-condition? bounds-condition? runtime-condition? runtime-limit-condition? runtime-cycle-condition? match-condition? syntax-condition? process-condition? access-condition? domain-condition? memory-condition?) (import scheme (chicken base) (chicken condition) (chicken type) condition-utils) (include-relative "condition-utils.inline") ;;; Builtin Conditions ; Signaled when a procedure is called with the wrong number of arguments. (define-condition-predicate arity-condition? exn arity) ; Signaled on type-mismatch errors, for example when an argument of the wrong ; type is passed to a built-in procedure. (define-condition-predicate type-condition? exn type) ; Signaled on arithmetic errors, like division by zero. (define-condition-predicate arithmetic-condition? exn arithmetic) ; Signaled on input/output errors. (define-condition-predicate i/o-condition? exn i/o) ; Signaled on file-related errors. (define-condition-predicate file-condition? exn i/o file) ; Signaled on network errors. (define-condition-predicate network-condition? exn i/o net) ; Signaled on network timeout errors. (define-condition-predicate network-timeout-condition? exn i/o net timeout) ; Signaled on errors caused by accessing non-existent elements of a collection. (define-condition-predicate bounds-condition? exn bounds) ; Signaled on low-level runtime-system error-situations. (define-condition-predicate runtime-condition? exn runtime) ; Signaled when an internal limit is exceeded (like running out of memory). (define-condition-predicate runtime-limit-condition? exn runtime limit) ; Signaled when a graph cycle detected. (define-condition-predicate runtime-cycle-condition? exn runtime cycle) ; Signaled on errors raised by failed matches (see the section on match). (define-condition-predicate match-condition? exn match) ; Signaled on syntax errors. (define-condition-predicate syntax-condition? exn syntax) ; Signaled on process errors. (define-condition-predicate process-condition? exn process) ; Signaled on access errors. (define-condition-predicate access-condition? exn access) ; Signaled on domain errors. (define-condition-predicate domain-condition? exn domain) ; Signaled on memory errors. (define-condition-predicate memory-condition? exn memory) ) ;standard-conditions