Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
wiseplat
GitHub Repository: wiseplat/python-code
Path: blob/master/ invest-robot-contest_TinkoffBotTwitch-main/venv/lib/python3.8/site-packages/tinkoff/invest/exceptions.py
7826 views
1
from typing import Any
2
3
from grpc import StatusCode
4
5
__all__ = (
6
"InvestError",
7
"RequestError",
8
"AioRequestError",
9
)
10
11
12
class InvestError(Exception):
13
pass
14
15
16
class RequestError(InvestError):
17
def __init__( # pylint:disable=super-init-not-called
18
self, code: StatusCode, details: str, metadata: Any
19
) -> None:
20
self.code = code
21
self.details = details
22
self.metadata = metadata
23
24
25
class AioRequestError(InvestError):
26
def __init__( # pylint:disable=super-init-not-called
27
self, code: StatusCode, details: str, metadata: Any
28
) -> None:
29
self.code = code
30
self.details = details
31
self.metadata = metadata
32
33
34
class MarketDataStreamError(InvestError):
35
pass
36
37
38
class IsNotSubscribedError(MarketDataStreamError):
39
pass
40
41