Skip to content

Commit

Permalink
Fix error display when generating containerized proxy config
Browse files Browse the repository at this point in the history
  • Loading branch information
cbosdo authored and juliogonzalez committed Jul 8, 2022
1 parent 54d2a04 commit 7d27393
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.redhat.rhn.common.RhnRuntimeException;
import com.redhat.rhn.domain.user.User;
import com.redhat.rhn.manager.system.SystemManager;
import com.redhat.rhn.manager.system.SystemsExistException;

import com.suse.manager.reactor.utils.LocalDateTimeISOAdapter;
import com.suse.manager.reactor.utils.OptionalTypeAdapterFactory;
Expand Down Expand Up @@ -128,6 +129,11 @@ public String generateContainerConfig(Request request, Response response, User u
return json(response, HttpStatus.SC_INTERNAL_SERVER_ERROR,
"Failed to generate proxy container configuration");
}
catch (SystemsExistException e) {
String msg = String.format("Cannot create proxy as an existing system has FQDN '%s'", data.getProxyFqdn());
LOG.error(msg);
return json(response, HttpStatus.SC_INTERNAL_SERVER_ERROR, msg);
}
catch (RhnRuntimeException e) {
return json(response, HttpStatus.SC_BAD_REQUEST, e.getMessage());
}
Expand Down

0 comments on commit 7d27393

Please sign in to comment.