From 35428314b5466b7286fc492662322c7dbde8faec Mon Sep 17 00:00:00 2001 From: Philippe Pittoli Date: Mon, 8 May 2023 19:34:57 +0200 Subject: [PATCH] Fix log messages. --- src/storage.cr | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/storage.cr b/src/storage.cr index 1fe0304..ebb42d8 100644 --- a/src/storage.cr +++ b/src/storage.cr @@ -89,7 +89,7 @@ class DNSManager::Storage Response::Success.new rescue e Baguette::Log.error "trying to add -or update- zone #{zone.domain}: #{e}" - Response::Error.new "error while updating the domain #{zone.domain}" + Response::Error.new "error while adding or updating the domain #{zone.domain}" end def add_rr(user_id : Int32, domain : String, rr : Zone::ResourceRecord) : IPC::JSON @@ -115,7 +115,7 @@ class DNSManager::Storage # Test RR validity. rr.get_errors.tap do |errors| unless errors.empty? - Baguette::Log.warning "Add RR with errors: #{errors}" + Baguette::Log.warning "add RR with errors: #{errors}" return Response::InvalidZone.new errors end end @@ -135,7 +135,7 @@ class DNSManager::Storage # User must exist. user_data = user_data_by_uid.get? user_id.to_s unless user_data - Baguette::Log.warning "unknown user #{user_id} tries to add -or update- zone #{domain}" + Baguette::Log.warning "unknown user #{user_id} tries to update a RR in domain #{domain}" return Response::UnknownUser.new end @@ -174,7 +174,7 @@ class DNSManager::Storage # User must exist. user_data = user_data_by_uid.get? user_id.to_s unless user_data - Baguette::Log.warning "unknown user #{user_id} tries to add -or update- zone #{domain}" + Baguette::Log.warning "unknown user #{user_id} tries to delete a RR in domain #{domain}" return Response::UnknownUser.new end @@ -197,8 +197,8 @@ class DNSManager::Storage Response::Success.new rescue e - Baguette::Log.error "trying to replace a resource record in domain #{domain}: #{e}" - Response::Error.new "error while replacing a resource record in domain #{domain}" + Baguette::Log.error "trying to remove a resource record in domain #{domain}: #{e}" + Response::Error.new "error while removing a resource record in domain #{domain}" end def delete_domain(user_id : Int32, domain : String) : IPC::JSON @@ -265,7 +265,7 @@ class DNSManager::Storage Response::DomainList.new user_data.domains rescue e - Baguette::Log.error "while listing all user #{user_id} domains: #{e}" + Baguette::Log.error "trying to list all user #{user_id} domains: #{e}" Response::Error.new "error while listing domains" end end