fix relays with same identity repalcing each other, throw error instead

This commit is contained in:
x032205
2025-11-05 13:13:57 -05:00
parent 839b0ede83
commit 100c1b0786

View File

@@ -996,7 +996,9 @@ export const relayServiceFactory = ({
);
if (existingRelay && (existingRelay.host !== host || existingRelay.name !== name)) {
return relayDAL.updateById(existingRelay.id, { host, name }, tx);
throw new BadRequestError({
message: `Machine identity already has an existing relay with the name "${existingRelay.name} and host "${existingRelay.host}". Delete the existing relay or use a different machine identity.`
});
}
if (!existingRelay) {