Skip to content

Commit

Permalink
removed circular import issues I think
Browse files Browse the repository at this point in the history
  • Loading branch information
John-Memphis committed Jan 16, 2024
1 parent 9197b9c commit 6ab029b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions memphis/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from dataclasses import dataclass
from memphis.consumer import Consumer

MAX_BATCH_SIZE = 5000

class MemphisError(Exception):
def __init__(self, message):
Expand All @@ -16,11 +17,9 @@ def __init__(self, message):
class MemphisConnectError(MemphisError):
pass


class MemphisSchemaError(MemphisError):
pass


class MemphisHeaderError(MemphisError):
pass

Expand All @@ -29,7 +28,7 @@ class MemphisErrors:
TimeoutError: MemphisError = MemphisError("Memphis: TimeoutError")
PartitionNumberKeyError: MemphisError = MemphisError('Can not use both partition number and partition key')
PartitionOutOfRange: MemphisError = MemphisError("Partition number is out of range")
InvalidBatchSize: MemphisError = MemphisError(f"Batch size can not be greater than {Consumer.MAX_BATCH_SIZE} or less than 1")
InvalidBatchSize: MemphisError = MemphisError(f"Batch size can not be greater than {MAX_BATCH_SIZE} or less than 1")
DeadConnection: MemphisError = MemphisError("Connection is dead")
MissingNameOrStationName: MemphisError = MemphisError("name and station name can not be empty")
MissingStationName : MemphisError = MemphisError("station name is missing")
Expand Down

0 comments on commit 6ab029b

Please sign in to comment.