client-py/venv/lib/python3.12/site-packages/whatthepatch/exceptions.py
2026-05-02 13:34:53 +05:00

31 lines
768 B
Python

class WhatThePatchException(Exception):
pass
class HunkException(WhatThePatchException):
def __init__(self, msg, hunk=None):
self.hunk = hunk
if hunk is not None:
super(HunkException, self).__init__(
"{msg}, in hunk #{n}".format(msg=msg, n=hunk)
)
else:
super(HunkException, self).__init__(msg)
class ApplyException(WhatThePatchException):
pass
class SubprocessException(ApplyException):
def __init__(self, msg, code):
super(SubprocessException, self).__init__(msg)
self.code = code
class HunkApplyException(HunkException, ApplyException, ValueError):
pass
class ParseException(HunkException, ValueError):
pass