2014-02-09 15:40:02 +01:00
|
|
|
# ex:ts=4:sw=4:sts=4:et
|
|
|
|
# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
|
|
|
|
2018-01-30 20:11:37 +01:00
|
|
|
|
2014-02-09 15:40:02 +01:00
|
|
|
class UIException(Exception):
|
|
|
|
pass
|
2015-09-06 14:19:10 +02:00
|
|
|
|
2018-01-30 20:11:37 +01:00
|
|
|
|
2015-09-06 14:19:10 +02:00
|
|
|
class ServiceError(Exception):
|
2016-03-29 19:42:46 +02:00
|
|
|
pass
|
|
|
|
|
2018-01-30 20:11:37 +01:00
|
|
|
|
2016-03-29 19:42:46 +02:00
|
|
|
class NoRequestedProtocols(UIException):
|
|
|
|
"""
|
|
|
|
This excpetion is thrown when the service provides streams,
|
|
|
|
but not using any accepted protocol (as decided by
|
|
|
|
options.stream_prio).
|
|
|
|
"""
|
|
|
|
|
|
|
|
def __init__(self, requested, found):
|
|
|
|
"""
|
|
|
|
The constructor takes two mandatory parameters, requested
|
|
|
|
and found. Both should be lists. requested is the protocols
|
|
|
|
we want and found is the protocols that can be used to
|
|
|
|
access the stream.
|
|
|
|
"""
|
|
|
|
self.requested = requested
|
|
|
|
self.found = found
|
|
|
|
|
2019-09-06 22:49:49 +02:00
|
|
|
super().__init__("None of the provided protocols (%s) are in " "the current list of accepted protocols (%s)" % (self.found, self.requested))
|
2016-03-29 19:42:46 +02:00
|
|
|
|
|
|
|
def __repr__(self):
|
2021-02-28 22:05:15 +01:00
|
|
|
return f"NoRequestedProtocols(requested={self.requested}, found={self.found})"
|