From 4fe6bd7c9e6e98cf2aabcaee1fe533877fdb49dc Mon Sep 17 00:00:00 2001 From: Philippe Pittoli Date: Mon, 3 Jul 2023 12:23:18 +0200 Subject: [PATCH] Specific message for domain deletion. --- src/responses/zone.cr | 7 +++++++ src/storage.cr | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/responses/zone.cr b/src/responses/zone.cr index 89bf3e0..8634807 100644 --- a/src/responses/zone.cr +++ b/src/responses/zone.cr @@ -1,5 +1,12 @@ class DNSManager::Response + IPC::JSON.message DomainDeleted, 9 do + property domain : String + def initialize(@domain) + end + end + DNSManager.responses << DomainDeleted + IPC::JSON.message InvalidZone, 10 do # For now, Error is just an alias on String. property errors : Array(Storage::Zone::Error) diff --git a/src/storage.cr b/src/storage.cr index 6c7e3f3..67e4fa3 100644 --- a/src/storage.cr +++ b/src/storage.cr @@ -276,7 +276,7 @@ class DNSManager::Storage # Remove the related zone. zones_by_domain.delete domain - Response::Success.new + Response::DomainDeleted.new domain rescue e Baguette::Log.error "trying to delete a domain #{domain}: #{e}" Response::Error.new "error while deleting the domain #{domain}"