public Domain get(@PathVariable("domainName") final String domainName) throws Error {
LOGGER.debug("Query for domain {}", domainName);
final DomainName dn;
try {
dn = DomainName.of(domainName);
Domain result = domainService.getDomain(dn);
if (result == null) {
LOGGER.debug("Domain result for '{}' is null. Throwing DomainNotFoundException", domainName);
throw new Error.DomainNotFound(dn);
}
return result;