tags:

views:

26

answers:

1

Rebol tells the error and the line but it doesn't say in what source file, is there a way to get this info from a system variable or else (not only the starting script) ?

+2  A: 

You might achieve that by overloading the DO function (given that all scripts are loaded in memory using DO and not LOAD or READ) to trace the last script executed before the error happens (only required if system/options/quiet is turned off by the library you're loading, so you don't see the DO native log line for each loaded script).

do: func [value /args arg /next][
    if file? value [print ["DOing script:" value]]
    case [
        args [system/words/do/args value arg]
        next [system/words/do/next value]
        ;-- args + next is possible, but never used in practice
    ]
]

Accurately link runtime errors to your source code is not always simple in REBOL. Once loaded in memory, there's no way to tell the origin (file or url) for any code block. Either find a way to catch it before at loading stage, or use verbose tracing output in console (using TRACE function or often better, with carefully placed PRINTs and/or PROBEs).

DocKimbel
Thanks good idea will try.
Rebol Tutorial