RE: [pyngl-talk] trying to catch exception

From: Ertl, John <john.ertl_at_nyahnyahspammersnyahnyah>
Date: Wed, 26 Jan 2005 09:54:43 -0800


My system is down for about an hour but I will give the wks value a try. I
did not know wks had a 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.


John Ertl

-----Original Message-----
From: David Ian Brown []
Sent: Wednesday, January 26, 2005 09:41
To: Ertl, John
Cc: ''' '
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,
I suppose the fact that it is set does not prove that X is running.

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 does not get caught.
> warning:GKS:GOPWK: --X driver error: DISPLAY environment variable not
> set
> 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 mailing list
Received on Wed Jan 26 2005 - 10:54:43 MST

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