1 """Standardized Error Messages"""
2
3 import traceback
4 import sys
5
7 try:
8 f = traceback.extract_stack(limit=up+2)
9 if f:
10 return f[0]
11 except:
12 if __debug__:
13 traceback.print_exc()
14 pass
15 return ('', 0, '', None)
16
18 """Common function for errors and Warnings"""
19 info=getLine(up=2)
20 print >>sys.stderr, "PyFoam",standard.upper(),"on line",info[1],"of file",info[0],":",
21 for t in text:
22 print >>sys.stderr,t,
23 print >>sys.stderr
24
26 """Prints a warning message with the occuring line number an aborts
27 @param text: The error message"""
28 __common("Warning",text)
29
31 """Prints an error message with the occuring line number an aborts
32 @param text: The error message"""
33 __common("Fatal Error",*text)
34 sys.exit(-1)
35