Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove empty catch blocks to stop swallowing exceptions. #498 #979

Merged
merged 1 commit into from
Dec 8, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 12 additions & 31 deletions src/main/java/com/gitblit/client/GitblitClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@
import com.gitblit.Constants.AuthorizationControl;
import com.gitblit.Constants.PermissionType;
import com.gitblit.Constants.RegistrantType;
import com.gitblit.GitBlitException.ForbiddenException;
import com.gitblit.GitBlitException.NotAllowedException;
import com.gitblit.GitBlitException.UnauthorizedException;
import com.gitblit.GitBlitException.UnknownRequestException;
import com.gitblit.Keys;
import com.gitblit.models.FederationModel;
import com.gitblit.models.FeedEntryModel;
Expand Down Expand Up @@ -119,34 +115,19 @@ public void login() throws IOException {
refreshRepositories();
refreshSubscribedFeeds(0);

try {
// credentials may not have administrator access
// or server may have disabled rpc management
refreshUsers();
if (protocolVersion > 1) {
refreshTeams();
}
allowManagement = true;
} catch (UnauthorizedException e) {
} catch (ForbiddenException e) {
} catch (NotAllowedException e) {
} catch (UnknownRequestException e) {
} catch (IOException e) {
e.printStackTrace();
}

try {
// credentials may not have administrator access
// or server may have disabled rpc administration
refreshStatus();
allowAdministration = true;
} catch (UnauthorizedException e) {
} catch (ForbiddenException e) {
} catch (NotAllowedException e) {
} catch (UnknownRequestException e) {
} catch (IOException e) {
e.printStackTrace();
// credentials may not have administrator access
// or server may have disabled rpc management
refreshUsers();
if (protocolVersion > 1) {
refreshTeams();
}
allowManagement = true;

// credentials may not have administrator access
// or server may have disabled rpc administration
refreshStatus();
allowAdministration = true;

}

public int getProtocolVersion() {
Expand Down