gb.canNotLoadRepository = Can not load repository
gb.commitIsNull = Commit is null
gb.unauthorizedAccessForRepository = Unauthorized access for repository
-gb.failedToFindCommit = Failed to find commit \"{0}\" in {1} for {2} page!
+gb.failedToFindCommit = Failed to find commit \"{0}\" in {1}!
gb.couldNotFindFederationProposal = Could not find federation proposal!
gb.invalidUsernameOrPassword = Invalid username or password!
gb.OneProposalToReview = There is 1 federation proposal awaiting review.
gb.myRepositories = my repositories
gb.noActivity = there has been no recent commit activity
gb.findSomeRepositories = find some repositories
+gb.metricAuthorExclusions = author metric exclusions
\ No newline at end of file
import javax.servlet.http.HttpServletRequest;\r
\r
import org.apache.wicket.Application;\r
+import org.apache.wicket.Page;\r
import org.apache.wicket.PageParameters;\r
import org.apache.wicket.RedirectToUrlException;\r
-import org.apache.wicket.RestartResponseException;\r
import org.apache.wicket.markup.html.CSSPackageResource;\r
import org.apache.wicket.markup.html.basic.Label;\r
import org.apache.wicket.markup.html.link.ExternalLink;\r
}\r
\r
public void error(String message, boolean redirect) {\r
- logger.error(message + " for " + GitBlitWebSession.get().getUsername());\r
- if (redirect) {\r
- GitBlitWebSession.get().cacheErrorMessage(message);\r
- String relativeUrl = urlFor(RepositoriesPage.class, null).toString();\r
- String absoluteUrl = RequestUtils.toAbsolutePath(relativeUrl);\r
- throw new RedirectToUrlException(absoluteUrl);\r
- } else {\r
- super.error(message);\r
- }\r
+ error(message, null, redirect ? getApplication().getHomePage() : null);\r
}\r
\r
public void error(String message, Throwable t, boolean redirect) {\r
- logger.error(message, t);\r
- if (redirect) {\r
+ error(message, t, getApplication().getHomePage());\r
+ }\r
+ \r
+ public void error(String message, Throwable t, Class<? extends Page> toPage) {\r
+ error(message, t, toPage, null);\r
+ }\r
+ \r
+ public void error(String message, Throwable t, Class<? extends Page> toPage, PageParameters params) {\r
+ if (t == null) {\r
+ logger.error(message + " for " + GitBlitWebSession.get().getUsername());\r
+ } else {\r
+ logger.error(message + " for " + GitBlitWebSession.get().getUsername(), t);\r
+ }\r
+ if (toPage != null) {\r
GitBlitWebSession.get().cacheErrorMessage(message);\r
- throw new RestartResponseException(getApplication().getHomePage());\r
+ String relativeUrl = urlFor(toPage, params).toString();\r
+ String absoluteUrl = RequestUtils.toAbsolutePath(relativeUrl);\r
+ throw new RedirectToUrlException(absoluteUrl);\r
} else {\r
super.error(message);\r
}\r
RevCommit commit = JGitUtils.getCommit(r, objectId);\r
if (commit == null) {\r
error(MessageFormat.format(getString("gb.failedToFindCommit"),\r
- objectId, repositoryName, getPageName()), true);\r
+ objectId, repositoryName, getPageName()), null, LogPage.class,\r
+ WicketUtils.newRepositoryParameter(repositoryName));\r
}\r
getSubmodules(commit);\r
return commit;\r