EGS Brachy
An egs++ user code for rapid brachytherapy calculations
Loading...
Searching...
No Matches
iaea_errors.py
Go to the documentation of this file.
1error_messages = {}
2
3
4new_source_errors = (
5
6 #errors returned in iaea_new_source
7
8 (105,'Header file not set'),
9
10 (-1,'Unable to initialize phase space'),
11 (-91,'Failed to get record contents'),
12 (-93,'Failed to read header'),
13 (-94,'Null file pointer to phase space file'),
14 (-95,'Failed to set record for new phase space file'),
15 (-96,'Phase space file failed to open'),
16 (-98,'Maximumn number of sources exceeded or invalid source id'),
17 (-99,'Invalid access mode'),
18 (-100,'Path to phase space file is too long'),
19 (-101,'Path to phase space file is too short')
20
21)
22
23error_messages.update(new_source_errors)
24
25class IAEAPhaseSpaceSetupError(Exception):
26 pass
27
28class IAEAPhaseSpaceError(Exception):
29 def __init__(self,err_id=None,message=""):
30 if err_id is not None:
31 try:
32 self.message = error_messages[err_id]
33 except KeyError:
34 self.message = "Unknown IAEAPhsp Error %s" % str(err_id)
35 else:
36 self.message = message
__init__(self, err_id=None, message="")