Specific message for domain deletion.

This commit is contained in:
Philippe Pittoli 2023-07-03 12:23:18 +02:00
parent 63da767caa
commit 4fe6bd7c9e
2 changed files with 8 additions and 1 deletions

View File

@ -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)

View File

@ -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}"