ansible-doctor/ansibledoctor/exception.py

23 lines
525 B
Python
Raw Normal View History

2019-10-08 11:30:31 +02:00
#!/usr/bin/env python3
2019-10-08 11:39:27 +02:00
"""Custom exceptions."""
2019-10-08 11:30:31 +02:00
class DoctorError(Exception):
"""Generic exception class for ansible-doctor."""
def __init__(self, msg, original_exception=""):
2020-04-11 14:00:54 +02:00
super(DoctorError, self).__init__("{msg}\n{org}".format(msg=msg, org=original_exception))
2019-10-08 11:30:31 +02:00
self.original_exception = original_exception
class ConfigError(DoctorError):
"""Errors related to config file handling."""
pass
class InputError(DoctorError):
"""Errors related to config file handling."""
pass