Source code for houndcore.app.errors.incorrect_rpc
fromhoundcore.app.scanners.baseimportScanner
[docs]classIncorrectRPC(Exception):'''raised when the RPC type doesn't match the Scanner needed RPC Args: scanner (:class:`houndcore.app.scanners.base.Scanner`): the Scanner rpc (str): the rpc'''def__init__(self,scanner:Scanner,rpc:str,):self.rpc_type="WebSocket"ifrpc.startswith("ws")else"HTTP"self.rpc=rpcself.scanner=scannerself.message=f"Scanner {self.scanner.__name__} Needs {'WebSocket'ifself.rpc_type=='HTTP'else'HTTP'} RPC not {self.rpc_type}"super().__init__(self.message)