Files
cachet-url-monitor/cachet_url_monitor/exceptions.py
mtakaki 5be0217c00 #10 - Creating auxiliary client class to generate configuration class (#78)
* #10 - Creating auxiliary client class to generate configuration class based on cachet's component list.

* Updating the python version in codacy to reduce false positives

* Moving some of the cachet operations to the client class to clean up the configuration class and making better constants

* Refactoring status to have proper classes and adding more tests. Refactoring the requests tests to use requests-mock.

* Removing unused imports from test_scheduler

* Adding more tests and the ability to run the client from command line

* Updating README and client arg parsing

* Fixing broken unit tests
2020-01-18 13:55:07 -08:00

20 lines
586 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.')