跳转到内容

Rebol 编程/throw-error

来自维基教科书,开放的书籍,为开放的世界
THROW-ERROR err-type err-id args 

使用提供的的信息立即抛出错误。

THROW-ERROR 是一个函数值。

  • err-type -- (类型:词语)
  • err-id -- (类型:词语)
  • args -- (类型:任何)

源代码

[编辑 | 编辑源代码]
throw-error: func [
    {Causes an immediate error throw with the provided information.} 
    err-type [word!] 
    err-id [word!] 
    args
][
    parse args: compose [(:args)] [0 3 [args: any-function! (
                change/only args copy/deep third first args
            ) | skip]] 
    args: head args 
    throw make error! reduce [err-type err-id pick args 1 pick args 2 pick args 3]
]
华夏公益教科书