Fix our response to internal errors in GET /user/:id/requiresTOTP

This commit is contained in:
Colin McDonald 2016-06-21 01:20:01 -04:00
parent 1eb09b9714
commit d466abe113
1 changed files with 2 additions and 0 deletions

View File

@ -15,6 +15,8 @@ public final class GETUserRequiresTOTP implements Handler<RoutingContext> {
public void handle(RoutingContext ctx) {
User.findById(ctx.request().getParam("id"), (user, error) -> {
if (error != null) {
ErrorUtils.respondInternalError(ctx, error);
} else if (user == null) {
ErrorUtils.respondNotFound(ctx, "User", ctx.request().getParam("id"));
} else {
String userIp = ctx.request().getParam("userIp");