Coverage for pdfrw/pdfrw/errors.py: 88%
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
Shortcuts on this page
r m x toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# A part of pdfrw (https://github.com/pmaupin/pdfrw)
2# Copyright (C) 2006-2015 Patrick Maupin, Austin, Texas
3# MIT license -- See LICENSE.txt for details
5'''
6PDF Exceptions and error handling
7'''
9import logging
12fmt = logging.Formatter('[%(levelname)s] %(filename)s:%(lineno)d %(message)s')
14handler = logging.StreamHandler()
15handler.setFormatter(fmt)
17log = logging.getLogger('pdfrw')
18log.setLevel(logging.WARNING)
19log.addHandler(handler)
22class PdfError(Exception):
23 "Abstract base class of exceptions thrown by this module"
25 def __init__(self, msg):
26 self.msg = msg
28 def __str__(self):
29 return self.msg
32class PdfParseError(PdfError):
33 "Error thrown by parser/tokenizer"
36class PdfOutputError(PdfError):
37 "Error thrown by PDF writer"
40class PdfNotImplementedError(PdfError):
41 "Error thrown on missing features"