trying to catch exception

From: Ertl, John <john.ertl_at_nyahnyahspammersnyahnyah>
Date: Wed, 26 Jan 2005 06:57:40 -0800


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

   def view(self,whatToView="c"):
        #### Uses PyNGL to view grid.
                wks = Ngl.open_wks("x11","job.test",None)

-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.

pyngl-talk mailing list
Received on Wed Jan 26 2005 - 07:57:40 MST

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