Skip to content

Commit 88844df

Browse files
fix(api): properly count desecapi_dynDNS12_domain_not_found
1 parent 1c6a687 commit 88844df

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

api/desecapi/views/dyndns.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,17 +114,15 @@ def qname(self):
114114
"code": "domain-unspecified",
115115
}
116116
)
117-
except Domain.DoesNotExist:
118-
metrics.get("desecapi_dynDNS12_domain_not_found").inc()
119-
raise NotFound("nohost")
120117

121118
@cached_property
122119
def domain(self):
123120
try:
124121
return Domain.objects.filter_qname(
125122
self.qname, owner=self.request.user
126123
).order_by("-name_length")[0]
127-
except (IndexError, ValueError):
124+
except (IndexError, ValueError, Domain.DoesNotExist):
125+
metrics.get("desecapi_dynDNS12_domain_not_found").inc()
128126
raise NotFound("nohost")
129127

130128
@property

0 commit comments

Comments
 (0)