Skip to content

Commit

Permalink
kafka: minor improvements of TOPIC_ALREADY_EXISTS error message (#1780)
Browse files Browse the repository at this point in the history
  • Loading branch information
4eUeP committed Mar 19, 2024
1 parent a46a984 commit abaef4c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion hstream-kafka/HStream/Kafka/Server/Core/Topic.hs
Expand Up @@ -58,7 +58,7 @@ createTopic ServerContext{..} name replicationFactor numPartitions configs = do
Left (e :: SomeException)
| isJust (fromException @S.EXISTS e) -> do
Log.warning $ "Topic already exists: " <> Log.build name
return ((K.TOPIC_ALREADY_EXISTS, "Topic " <> name <> " already exists"), [])
return ((K.TOPIC_ALREADY_EXISTS, "Topic '" <> name <> "' already exists."), [])
| otherwise -> do
Log.warning $ "Exception occurs when creating stream " <> Log.build (show streamId) <> ": " <> Log.build (show e)
return ((K.UNKNOWN_SERVER_ERROR, "Unexpected Server error"), [])
Expand Down
4 changes: 2 additions & 2 deletions hstream-kafka/HStream/Kafka/Server/Handler/Topic.hs
Expand Up @@ -66,9 +66,9 @@ handleCreateTopics ctx@ServerContext{scLDClient} reqCtx K.CreateTopicsRequest{..
exist <- S.doesStreamExist scLDClient streamId
if exist
then do
Log.info $ "Topic " <> Log.build name <> " already exist."
Log.info $ "Topic " <> Log.build name <> " already exists."
return K.CreatableTopicResult
{ errorMessage=Just $ "Topic " <> name <> " already exist."
{ errorMessage=Just $ "Topic '" <> name <> "' already exists."
, errorCode=K.TOPIC_ALREADY_EXISTS
, name=name
}
Expand Down

0 comments on commit abaef4c

Please sign in to comment.