Package dbf :: Module exceptions
[hide private]

Source Code for Module dbf.exceptions

 1  "warnings and errors" 
 2   
3 -class DbfError(Exception):
4 "Fatal errors elicit this response." 5 pass
6 -class DataOverflow(DbfError):
7 "Data too large for field"
8 - def __init__(yo, message, data=None):
9 super(DataOverflow, yo).__init__(message) 10 yo.data = data
11 -class FieldMissing(KeyError, DbfError):
12 "Field does not exist in table"
13 - def __init__(yo, fieldname):
14 super(FieldMissing, yo).__init__('%s: no such field in table' % fieldname) 15 yo.data = fieldname
16 -class NonUnicode(DbfError):
17 "Data for table not in unicode"
18 - def __init__(yo, message=None):
19 super(NonUnicode, yo).__init__(message)
20 -class DbfWarning(Exception):
21 "Normal operations elicit this response"
22 -class Eof(DbfWarning, StopIteration):
23 "End of file reached" 24 message = 'End of file reached'
25 - def __init__(yo):
26 super(Eof, yo).__init__(yo.message)
27 -class Bof(DbfWarning, StopIteration):
28 "Beginning of file reached" 29 message = 'Beginning of file reached'
30 - def __init__(yo):
31 super(Bof, yo).__init__(yo.message)
32