Add context to InternalRepositoryException

This commit is contained in:
René Pfeuffer
2018-11-06 09:14:20 +01:00
parent f1c9fe56f0
commit cf05235dfa
33 changed files with 106 additions and 73 deletions

View File

@@ -56,6 +56,8 @@ import sonia.scm.util.Util;
import java.io.File;
import static sonia.scm.ContextEntry.ContextBuilder.entity;
//~--- JDK imports ------------------------------------------------------------
/**
@@ -173,7 +175,8 @@ public class SvnRepositoryHandler
}
catch (SVNException ex)
{
throw new InternalRepositoryException(ex);
logger.error("could not create svn repository", ex);
throw new InternalRepositoryException(entity(repository), "could not create repository", ex);
}
finally
{

View File

@@ -98,7 +98,7 @@ public class SvnBlameCommand extends AbstractSvnCommand implements BlameCommand
}
catch (SVNException ex)
{
throw new InternalRepositoryException("could not create blame result", ex);
throw new InternalRepositoryException(repository, "could not create blame result", ex);
}
return new BlameResult(blameLines.size(), blameLines);

View File

@@ -137,7 +137,7 @@ public class SvnCatCommand extends AbstractSvnCommand implements CatCommand
} else if (SVNErrorCode.FS_NO_SUCH_REVISION.getCode() == svnErrorCode) {
throw notFound(entity("Revision", request.getRevision()).in(repository));
} else {
throw new InternalRepositoryException("could not get content from revision", ex);
throw new InternalRepositoryException(repository, "could not get content from revision", ex);
}
}
@@ -157,7 +157,7 @@ public class SvnCatCommand extends AbstractSvnCommand implements CatCommand
}
catch (SVNException ex)
{
throw new InternalRepositoryException("could not get content from transaction", ex);
throw new InternalRepositoryException(repository, "could not get content from transaction", ex);
}
finally
{

View File

@@ -120,7 +120,7 @@ public class SvnDiffCommand extends AbstractSvnCommand implements DiffCommand
}
catch (SVNException ex)
{
throw new InternalRepositoryException("could not create diff", ex);
throw new InternalRepositoryException(repository, "could not create diff", ex);
}
finally
{

View File

@@ -97,7 +97,7 @@ public class SvnLogCommand extends AbstractSvnCommand implements LogCommand
}
catch (SVNException ex)
{
throw new InternalRepositoryException("could not open repository", ex);
throw new InternalRepositoryException(repository, "could not open repository", ex);
}
return changeset;
@@ -139,7 +139,7 @@ public class SvnLogCommand extends AbstractSvnCommand implements LogCommand
}
catch (SVNException ex)
{
throw new InternalRepositoryException("could not open repository", ex);
throw new InternalRepositoryException(repository, "could not open repository", ex);
}
return changesets;

View File

@@ -34,7 +34,7 @@ public class SvnModificationsCommand extends AbstractSvnCommand implements Modif
modifications = SvnUtil.createModifications(entries.iterator().next(), revision);
}
} catch (SVNException ex) {
throw new InternalRepositoryException("could not open repository", ex);
throw new InternalRepositoryException(repository, "could not open repository", ex);
}
return modifications;
}