mirror of https://github.com/zlatinb/muwire
more descriptive errors on Browse and Feed submit actions
parent
9646eadcb1
commit
c6c1ac1d93
|
@ -133,14 +133,14 @@ public class BrowseServlet extends HttpServlet {
|
||||||
if (action.equals("browse")) {
|
if (action.equals("browse")) {
|
||||||
String personaB64 = req.getParameter("host");
|
String personaB64 = req.getParameter("host");
|
||||||
if (personaB64 == null) {
|
if (personaB64 == null) {
|
||||||
resp.sendError(403,"Bad param");
|
resp.sendError(403,Util._t("Please enter a full MuWire id"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Persona host;
|
Persona host;
|
||||||
try {
|
try {
|
||||||
host = new Persona(new ByteArrayInputStream(Base64.decode(personaB64)));
|
host = new Persona(new ByteArrayInputStream(Base64.decode(personaB64)));
|
||||||
} catch (Exception bad) {
|
} catch (Exception bad) {
|
||||||
resp.sendError(403,"Bad param");
|
resp.sendError(403,Util._t("Please enter a full MuWire id"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
browseManager.browse(host);
|
browseManager.browse(host);
|
||||||
|
|
|
@ -110,14 +110,14 @@ public class FeedServlet extends HttpServlet {
|
||||||
if (action.equals("subscribe")) {
|
if (action.equals("subscribe")) {
|
||||||
String personaB64 = req.getParameter("host");
|
String personaB64 = req.getParameter("host");
|
||||||
if (personaB64 == null) {
|
if (personaB64 == null) {
|
||||||
resp.sendError(403,"Bad param");
|
resp.sendError(403, Util._t("Please enter a full MuWire id"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Persona host;
|
Persona host;
|
||||||
try {
|
try {
|
||||||
host = new Persona(new ByteArrayInputStream(Base64.decode(personaB64)));
|
host = new Persona(new ByteArrayInputStream(Base64.decode(personaB64)));
|
||||||
} catch (Exception bad) {
|
} catch (Exception bad) {
|
||||||
resp.sendError(403,"Bad param");
|
resp.sendError(403, Util._t("Please enter a full MuWire id"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
feedManager.subscribe(host);
|
feedManager.subscribe(host);
|
||||||
|
|
Loading…
Reference in New Issue