File: errors.py

package info (click to toggle)
python-mmcif-pdbx 2.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 10,000 kB
  • sloc: python: 1,389; makefile: 25
file content (17 lines) | stat: -rw-r--r-- 412 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
"""Error classes for PDBx/mmCIF."""


class PdbxError(Exception):
    """Class for general errors."""


class PdbxSyntaxError(Exception):
    """Class for syntax errors."""

    def __init__(self, line_number, text):
        super().__init__(self)
        self.line_number = line_number
        self.text = text

    def __str__(self):
        return "%%ERROR - [at line: %d] %s" % (self.line_number, self.text)