1
0
mirror of https://github.com/checktheroads/hyperglass synced 2024-05-11 05:55:08 +00:00
Matt Love b7747cf1df Async all the things
Flask → Sanic, Requests → HTTP3, Add SSHTunnel for SSH Proxying, Remove Gunicorn dependency
2019-07-15 02:30:42 -07:00

60 lines
1.2 KiB
Python

"""
Custom exceptions for hyperglass
"""
class HyperglassError(Exception):
"""
hyperglass base exception.
"""
class ConfigError(HyperglassError):
"""
Raised for user-inflicted configuration issues. Examples:
- Fat fingered NOS in device definition
- Used invalid type (str, int, etc.) in hyperglass.yaml
"""
def __init__(self, message):
super().__init__(message)
self.message = message
def __str__(self):
return self.message
class CantConnect(HyperglassError):
def __init__(self, message):
super().__init__(message)
self.message = message
def __str__(self):
return self.message
class ParseError(HyperglassError):
"""
Raised when an ouput parser encounters an error.
"""
def __init__(self, message):
super().__init__(message)
self.message = message
def __str__(self):
return self.message
class UnsupportedDevice(HyperglassError):
"""
Raised when an input NOS is not in the supported NOS list.
"""
def __init__(self, message):
super().__init__(message)
self.message = message
def __str__(self):
return self.message