diff --git a/memphis/exceptions.py b/memphis/exceptions.py index 75044d5..fa63aa5 100644 --- a/memphis/exceptions.py +++ b/memphis/exceptions.py @@ -88,26 +88,26 @@ class MemphisErrors: "Unsupported message type" ) - def expecting_format(error: Exception, format: str): + def expecting_format(self, error: Exception, format: str): return MemphisError(f"Expecting {format} format: " + str(error)) - def expecting_json(error: Exception): + def expecting_json(self, error: Exception): pass - def schema_validation_failed(error): + def schema_validation_failed(self, error): return MemphisSchemaError("Schema validation has failed: " + str(error)) - def schema_msg_mismatch(error: Exception): + def schema_msg_mismatch(self, error: Exception): return MemphisSchemaError( f"Deserialization has been failed since the message format does not align with the currently attached schema: {str(error)}" ) - def partition_not_in_station(partition_number, station_name): + def partition_not_in_station(self, partition_number, station_name): return MemphisError( f"Partition {str(partition_number)} does not exist in station {station_name}" ) - def invalid_schema_type(schema_type): + def invalid_schema_type(self, schema_type): return MemphisError( "schema type not supported" + schema_type diff --git a/memphis/message.py b/memphis/message.py index 661f3cc..b50172d 100644 --- a/memphis/message.py +++ b/memphis/message.py @@ -5,7 +5,6 @@ from memphis.exceptions import ( MemphisConnectError, MemphisError, - MemphisSchemaError, MemphisErrors, ) from memphis.station import Station