mirror of
https://github.com/checktheroads/hyperglass
synced 2024-05-11 05:55:08 +00:00
model restructure, front-end improvements
This commit is contained in:
@@ -6,7 +6,7 @@ Custom exceptions for hyperglass
|
||||
class HyperglassError(Exception):
|
||||
"""hyperglass base exception"""
|
||||
|
||||
def __init__(self, message="", alert="warning", keywords={}):
|
||||
def __init__(self, message="", alert="warning", keywords=[]):
|
||||
self.message = message
|
||||
self.alert = alert
|
||||
self.keywords = keywords
|
||||
@@ -105,6 +105,19 @@ class InputNotAllowed(HyperglassError):
|
||||
super().__init__(message=self.message, alert=self.alert, keywords=self.keywords)
|
||||
|
||||
|
||||
class ResponseEmpty(HyperglassError):
|
||||
"""
|
||||
Raised when hyperglass is able to connect to the device and execute
|
||||
a valid query, but the response is empty.
|
||||
"""
|
||||
|
||||
def __init__(self, unformatted_msg, **kwargs):
|
||||
self.message = unformatted_msg.format(**kwargs)
|
||||
self.alert = "warning"
|
||||
self.keywords = [value for value in kwargs.values()]
|
||||
super().__init__(message=self.message, alert=self.alert, keywords=self.keywords)
|
||||
|
||||
|
||||
class UnsupportedDevice(HyperglassError):
|
||||
"""Raised when an input NOS is not in the supported NOS list."""
|
||||
|
||||
|
Reference in New Issue
Block a user