Last modified on 13 November 2012, at 10:47

REBOL Programming/throw-on-error

USAGE:Edit

THROW-ON-ERROR blk 

DESCRIPTION:Edit

Evaluates a block, which if it results in an error, throws that error.

THROW-ON-ERROR is a function value.

ARGUMENTSEdit

  • blk -- (Type: block)

(SPECIAL ATTRIBUTES)Edit

  • throw

SOURCE CODEEdit

throw-on-error: func [
    {Evaluates a block, which if it results in an error, throws that error.} 
    [throw] 
    blk [block!]
][
    if error? set/any 'blk try blk [throw blk] 
    get/any 'blk
]