aboutsummaryrefslogtreecommitdiff
path: root/juick-api/src/main/java/com/juick/api/PM.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2016-11-23 12:08:45 +0300
committerGravatar Vitaly Takmazov2016-11-23 12:08:45 +0300
commit42718787291bed507caf4f7ae13f6c41f9b8d7ff (patch)
tree2ba7bb057a6a740e98c5f4d6dae813af1a6b977f /juick-api/src/main/java/com/juick/api/PM.java
parentaa3c1a06ed46f49b617e2956b6cf9a1b0d367fb0 (diff)
using HttpServletResponse status codes
Diffstat (limited to 'juick-api/src/main/java/com/juick/api/PM.java')
-rw-r--r--juick-api/src/main/java/com/juick/api/PM.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/juick-api/src/main/java/com/juick/api/PM.java b/juick-api/src/main/java/com/juick/api/PM.java
index 86d9c534..1e06e67d 100644
--- a/juick-api/src/main/java/com/juick/api/PM.java
+++ b/juick-api/src/main/java/com/juick/api/PM.java
@@ -39,7 +39,7 @@ public class PM {
}
if (uid == 0) {
- response.sendError(400);
+ response.sendError(HttpServletResponse.SC_BAD_REQUEST);
return;
}
@@ -48,7 +48,7 @@ public class PM {
String json = messageSerializer.serializeList(msgs);
Main.replyJSON(request, response, json);
} else {
- response.sendError(404);
+ response.sendError(HttpServletResponse.SC_NOT_FOUND);
}
}
@@ -63,12 +63,12 @@ public class PM {
String body = request.getParameter("body");
if (uid == 0 || body == null || body.length() < 1 || body.length() > 10240) {
- response.sendError(400);
+ response.sendError(HttpServletResponse.SC_BAD_REQUEST);
return;
}
if (UserQueries.isInBLAny(sql, uid, vuid)) {
- response.sendError(403);
+ response.sendError(HttpServletResponse.SC_FORBIDDEN);
return;
}
@@ -103,7 +103,7 @@ public class PM {
}
} else {
- response.sendError(500);
+ response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
}
}
}