Re: trying to catch exception

From: David Ian Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Wed, 26 Jan 2005 11:17:41 -0700

The return value of Ngl.open_wks is just an integer id used to
identify the workstation. Typically when the call fails, it will be
set to -4, which is actually the error code for a 'fatal' error.

Someone else will have to address the question of GPFS. I know
nothing about it.
  -dave

On Jan 26, 2005, at 10:54 AM, Ertl, John wrote:

> Dave,
>
> My system is down for about an hour but I will give the wks value a
> try. I
> did not know wks had a value...is it a particular parameter of wks
> such as
> wks.status? Thanks for the idea.
>
> This is off topic but we are putting together a large Linux cluster and
> using GPFS...we are having all kinds of problems with GPFS are any of
> you
> users using GPFS on a Linux system running Red Hat Enterprise 3.0? I
> am not
> a system guy but I was wondering if we where alone in this problem or
> not.
>
> Thanks
>
> John Ertl
>
> -----Original Message-----
> From: David Ian Brown [mailto:dbrown_at_ucar.edu]
> Sent: Wednesday, January 26, 2005 09:41
> To: Ertl, John
> Cc: ''pyngl-talk_at_ucar.edu' '
> Subject: Re: trying to catch exception
>
> Hi John,
>
> You can check the value of wks after the Ngl.open_wks call. If
> it's less than 0, you know it did not succeed, and you can prevent
> the later calls that result in the segfault.
>
> In this case the first set of error messages will still appear.
>
> Another possibility is to check the DISPLAY environment variable
> before calling Ngl.open_wks. If it's not set then X is not running,
> although
> I suppose the fact that it is set does not prove that X is running.
> -dave
>
> On Jan 26, 2005, at 7:57 AM, Ertl, John wrote:
>
>>
>> All,
>>
>> I have program that uses an x11 window to view plots if the user wants
>> to
>> but some people do not have a system that allows an x11 window. I am
>> trying
>> to gracfull continue the program and display an error message instead
>> of
>> crashing when this happens.
>>
>> I have tried the below try statment and some other stuff but no luck.
>> Any
>> ideas.
>>
>> def view(self,whatToView="c"):
>> #### Uses PyNGL to view grid.
>> try:
>> wks = Ngl.open_wks("x11","job.test",None)
>> except:
>> return
>>
>>
>> -error from the above try...it does not get caught.
>> warning:GKS:GOPWK: --X driver error: DISPLAY environment variable not
>> set
>> warning:GKS:GESC: --SPECIFIED WORKSTATION IS NOT OPEN
>> fatal:Workstation with PID#7 is not open
>> fatal:Unable to open Workstation-Can't Create
>>
>> -error from further down in function
>> fatal:PID #-4 can't be found in NhlSetValues
>> fatal:_NhlCreate:Invalid Parent id #-4
>> fatal:NhlGetValues:PID #-4 is invalid
>> fatal:NhlGetValues:PID #-4 is invalid
>> Segmentation fault
>>
>> Thanks for the help.
>>
>> John
>> _______________________________________________
>> pyngl-talk mailing list
>> pyngl-talk_at_ucar.edu
>> http://mailman.ucar.edu/mailman/listinfo/pyngl-talk

_______________________________________________
pyngl-talk mailing list
pyngl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/pyngl-talk
Received on Wed Jan 26 2005 - 11:17:41 MST

This archive was generated by hypermail 2.2.0 : Thu Jan 19 2006 - 21:31:52 MST