roxen.lists.pike.general

Subject Author Date
Re: error handling Bill Welliver <hww3[at]riverweb[dot]com> 02-09-2009
i threw some material together and put up a how-to on the pike wiki:

http://www.gotpike.org/PikeWiki/index.pike/PikeDevel/HowTo/Redirect+Compilation+Notices

hopefully this will be helpful.

i imagine the reason that the api docs don't talk about how to get things 
back out is that it isn't critical to the operation of the compiler: that 
is, the compiler only cares about telling the handler about the errors. 
you could devise whatever method you wanted for dealing with the errors 
once submitted.

best,

bill

On Wed, 2 Sep 2009, Yvan Vander Sanden wrote:

> Hi.
>
> I am using catch when running
>
> program p = compile_file(filename);
>
> for catching any error. This works, but i would also like to redirect the
> messages about what is wrong with the file, like:
>
> test.pike:12:Missing ')'.
>
> This is printed to the console before i can print my error. It seems i need
> need an error handler and add that to the compile_file methods.
>
> But I can't get it done with the reference manual. Mainly, how do i make
> such and object? just
>
> object handler = CompilationHandler();
>
> is obviously not correct. And the documentation lists several methods to
> write to the handle, but none to retrieve the information from it.
>
> Does anyone have a more concrete example of how to do this?
>
> regards,
>
> yvan
>
> -- 
> Copyright only exists in the imagination of those who do not have any.
>