Hello.

The  commands *try* and *catch* and all you guys said was not what I
expected in your answers.  I was only asking whether there is an option in
rivet that disables the output buffer.
Using *try* and *catch* means that I will write *try* and *catch* for each
command I write instead of the whole script. That will be daunting and
tedious.

I read and tried examples about *try* and *catch* in the tcl wiki, but it
does not help at all in web development.

The *try* command can take a block of commands but still output buffer is
still printed out in case of an error.

The catch command can take a block of commands and does hide the output
buffer , still I will have to write my own error messages which I am not
supposed to do. This is the job of the Tcl interpreter.

I can go with your *try *and *catch * method of handling errors if you
write a page of examples dedicated to rivet in http://wiki.tcl.tk
Thanks

On 31 Jan 2018 5:53 pm, "Massimo Manghi" <[email protected]> wrote:

> If you need to catch also errors that might escape the good practice of
> having ::rivet::catch and ::rivet::try control critical section of code you
> may set up an ErrorScript
>
> RivetServerConf ErrorScript "source <path-to-my-error-handler>.tcl"
>
> You can virtually do anything with the error codes from within this
> handler, including redirection (provided you haven't already sent the HTTP
> headers)
>
> notice the FQ scoping of the commands which is important if you are using
> ::rivet::abort_page in your code (you can also trick mod_rivet into issuing
> error codes that can be interpreted as calls to this commands, see the
> mod_rivet code) or if you have some 'exit' calls in your scripts which
> actually is *the-wrong-thing-to-do* to interrupt a script controlled by
> mod_rivet (either Rivet 2.x or 3.0 and any Tcl version as long as Tcl will
> not enable us to delete interpreters in a sane and safe way)
>
>  -- Massimo
>
> On 01/31/2018 03:28 PM, Brice Hamon wrote:
>
>> Use try {} catch {} in each of your .rvt file and in case of error take
>> the appropriate action (log redirect etc...)
>>
>> On Wed, Jan 31, 2018 at 4:58 AM, Rani Ahmed <[email protected] <mailto:
>> [email protected]>> wrote:
>>
>>     hello .
>>
>>     How can I disable the output buffer in case of an error or a bug in
>>     my code? It's annoying and It can print the passwords sometimes
>>     which I pass to TDBC database connection. It also prints the actual
>>     Tcl code of my website.
>>
>>     Thanks.
>>
>>
>>

Reply via email to