开发者

Is it possible to intercept rebol's console error?

开发者 https://www.devze.com 2022-12-09 22:01 出处:网络
Let\'s say I type a stupid command in Rebol Console like >> AWordThatMeansNothing ** Script Error: AWordThatMeansNothing has no value

Let's say I type a stupid command in Rebol Console like

>> AWordThatMeansNothing
** Script Error: AWordThatMeansNothing has no value
** Near: AWordThatMeansNothing
>>

I want to intercept the above error to display another message or do anything I nee开发者_Python百科d to when I get an error in Console.


One way is to add a small front end to the console. Not perfect, but a start:

forever [
    if error? try [
        print do input][
           print "went bad!"
           ]
   ]
0

精彩评论

暂无评论...
验证码 换一张
取 消