EmailReviewComments: Throw OutOfScopeException for current user

This matches the behavior of ChangeMergeQueue's RequestContext
implementation, and replaces a lurking NPE with a more descriptive
error.

Change-Id: I35dfd750980df70173a797b5b2147ee88d715b77
This commit is contained in:
Dave Borowitz 2014-09-18 16:02:42 -07:00
parent ebc0f424a8
commit c8c17ec5fb

@ -32,6 +32,7 @@ import com.google.gerrit.server.util.ThreadLocalRequestContext;
import com.google.gwtorm.server.OrmException;
import com.google.gwtorm.server.SchemaFactory;
import com.google.inject.Inject;
import com.google.inject.OutOfScopeException;
import com.google.inject.Provider;
import com.google.inject.ProvisionException;
import com.google.inject.assistedinject.Assisted;
@ -152,7 +153,7 @@ public class EmailReviewComments implements Runnable, RequestContext {
@Override
public CurrentUser getCurrentUser() {
return null;
throw new OutOfScopeException("No user on email thread");
}
@Override