REBOL 3 Docs Guide Concepts Functions Datatypes Errors
  TOC < Back Next >   Updated: 3-Aug-2010 Edit History  

REBOL 3 Functions: to-error

to-error  value

Converts to error! value.



See also:

make   to  


Returns an error! value made from the given value.

probe disarm try [to-error "Oops! My error."]
make object! [
code: 308
type: 'Script
id: 'cannot-use
arg1: 'to
arg2: unset!
arg3: none
near: [to error! :value]
where: [to to-error try do attempt if emit parse foreach catch if either if do begin do]


Note that this differs from TO and MAKE in that you have to wrap the call in a TRY block to catch the error it makes.

  TOC < Back Next > - WIP Wiki Feedback Admin