Skip to content

Commit

Permalink
fix:acmedns: handle "An identical record already exists"
Browse files Browse the repository at this point in the history
  • Loading branch information
yzqzss committed Nov 12, 2024
1 parent 09e4881 commit 1675172
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -862,12 +862,17 @@ class Listener {
try {
actres = await CFAPI.setRecord(zone_id, json.subdomain, json.txt);
} catch (e) {
return dns01cfError(`Error during DNS update: ${e.message}`, { status: 500 });
if (e.message.includes("An identical record already exists")) {
actres = { message: e.message };
} else {
return dns01cfError(`Error during DNS update: ${e.message}`, { status: 500 });
}
}
return dns01cfResponse(
{
result: "ok",
message: `'${json.subdomain}' set to value '${json.txt}'`,
acmedns_success_msg: `${json.txt}`,
response: actres,
},
{ status: 200 },
Expand Down

0 comments on commit 1675172

Please sign in to comment.