Skip to content
angerangel edited this page Mar 15, 2013 · 1 revision

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
    ]
] ]

Clone this wiki locally