mirror of
https://github.com/mtan93/cachet-url-monitor.git
synced 2026-03-08 05:31:58 +00:00
* #83 - Fixing the bug that was preventing the status update * #83 - Refactoring unit tests for configuration to ensure we catch more cases
29 lines
809 B
Python
29 lines
809 B
Python
#!/usr/bin/env python
|
|
class ComponentNonexistentError(Exception):
|
|
"""Exception raised when the component does not exist."""
|
|
|
|
def __init__(self, component_id):
|
|
self.component_id = component_id
|
|
|
|
def __str__(self):
|
|
return repr(f'Component with id [{self.component_id}] does not exist.')
|
|
|
|
|
|
class MetricNonexistentError(Exception):
|
|
"""Exception raised when the component does not exist."""
|
|
|
|
def __init__(self, metric_id):
|
|
self.metric_id = metric_id
|
|
|
|
def __str__(self):
|
|
return repr(f'Metric with id [{self.metric_id}] does not exist.')
|
|
|
|
|
|
class ConfigurationValidationError(Exception):
|
|
"""Exception raised when there's a validation error."""
|
|
|
|
def __init__(self, value):
|
|
self.value = value
|
|
|
|
def __str__(self):
|
|
return repr(self.value) |