- public boolean submit(PrintWriter out, HttpServletRequest req) throws GigiApiException {
- if (req.getParameter("emailType") != null) {
- String mail = AUTHORATIVE_EMAILS[Integer.parseInt(req.getParameter("email"))];
- target.addPing(PingType.EMAIL, mail);
+ public boolean submit(HttpServletRequest req) throws GigiApiException {
+ target.clearPings();
+ if (req.getParameter("emailType") != null && req.getParameter("email") != null) {
+ try {
+ String mail = AUTHORATIVE_EMAILS[Integer.parseInt(req.getParameter("email"))];
+ target.addPing(DomainPingType.EMAIL, mail);
+ } catch (NumberFormatException e) {
+ throw new GigiApiException("A email address is required");
+ }