Cause error

angerangel edited this page Jan 2, 2013 · 1 revision
Clone this wiki locally

Table of Contents

USAGE

  CAUSE-ERROR err-type err-id args

DESCRIPTION

Causes an immediate error throw with the provided information. CAUSE-ERROR is a function value.

ARGUMENTS

  • err-type (word!)
  • err-id (word!)
  • args

SOURCE

cause-error: make function! [  [
    {Causes an immediate error throw with the provided information.}
    err-type [word!]
    err-id [word!]
    args
][
    args: compose [(:args)]
    forall args [
        if any-function? first args [
            change/only args spec-of first args
        ]
    ]
    do make error! [
        type: err-type
        id: err-id
        arg1: first args
        arg2: second args
        arg3: third args
    ]
] ]