annotate qed/errors.py @ 2:5f1d98674a21 draft default tip

Uploaded
author bgruening
date Sun, 20 Apr 2014 09:03:37 -0400
parents bb92d30b4f52
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
1 __all__ = ['SilicosItError', 'WrongArgument']
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
2
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
3 class SilicosItError(Exception):
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
4 """Base class for exceptions in Silicos-it code"""
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
5 pass
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
6
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
7 class WrongArgument(SilicosItError):
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
8 """
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
9 Exception raised when argument to function is not of correct type.
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
10
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
11 Attributes:
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
12 function -- function in which error occurred
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
13 msg -- explanation of the error
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
14 """
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
15 def __init__(self, function, msg):
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
16 self.function = function
bb92d30b4f52 Uploaded
bgruening
parents:
diff changeset
17 self.msg = msg