[DS-4548] Satisfy Checkstyle.

This commit is contained in:
Mark H. Wood
2021-08-04 12:02:21 -04:00
parent b43e5dfdd8
commit f4b1e4b2ff
3 changed files with 30 additions and 10 deletions

View File

@@ -76,7 +76,9 @@ public class HandleIdentifierProvider extends IdentifierProvider {
return id; return id;
} catch (IOException | SQLException | AuthorizeException e) { } catch (IOException | SQLException | AuthorizeException e) {
log.error(LogHelper.getHeader(context, "Error while attempting to create handle", "Item id: " + dso.getID()), e); log.error(LogHelper.getHeader(context,
"Error while attempting to create handle",
"Item id: " + dso.getID()), e);
throw new RuntimeException("Error while attempting to create identifier for Item id: " + dso.getID(), e); throw new RuntimeException("Error while attempting to create identifier for Item id: " + dso.getID(), e);
} }
} }
@@ -90,7 +92,9 @@ public class HandleIdentifierProvider extends IdentifierProvider {
populateHandleMetadata(context, item, identifier); populateHandleMetadata(context, item, identifier);
} }
} catch (IOException | IllegalStateException | SQLException | AuthorizeException e) { } catch (IOException | IllegalStateException | SQLException | AuthorizeException e) {
log.error(LogHelper.getHeader(context, "Error while attempting to create handle", "Item id: " + dso.getID()), e); log.error(LogHelper.getHeader(context,
"Error while attempting to create handle",
"Item id: " + dso.getID()), e);
throw new RuntimeException("Error while attempting to create identifier for Item id: " + dso.getID(), e); throw new RuntimeException("Error while attempting to create identifier for Item id: " + dso.getID(), e);
} }
} }
@@ -101,7 +105,9 @@ public class HandleIdentifierProvider extends IdentifierProvider {
try { try {
handleService.createHandle(context, dso, identifier); handleService.createHandle(context, dso, identifier);
} catch (IllegalStateException | SQLException e) { } catch (IllegalStateException | SQLException e) {
log.error(LogHelper.getHeader(context, "Error while attempting to create handle", "Item id: " + dso.getID()), e); log.error(LogHelper.getHeader(context,
"Error while attempting to create handle",
"Item id: " + dso.getID()), e);
throw new RuntimeException("Error while attempting to create identifier for Item id: " + dso.getID()); throw new RuntimeException("Error while attempting to create identifier for Item id: " + dso.getID());
} }
} }
@@ -123,7 +129,9 @@ public class HandleIdentifierProvider extends IdentifierProvider {
try { try {
return handleService.createHandle(context, dso); return handleService.createHandle(context, dso);
} catch (SQLException e) { } catch (SQLException e) {
log.error(LogHelper.getHeader(context, "Error while attempting to create handle", "Item id: " + dso.getID()), e); log.error(LogHelper.getHeader(context,
"Error while attempting to create handle",
"Item id: " + dso.getID()), e);
throw new RuntimeException("Error while attempting to create identifier for Item id: " + dso.getID()); throw new RuntimeException("Error while attempting to create identifier for Item id: " + dso.getID());
} }
} }

View File

@@ -240,7 +240,9 @@ public class VersionedHandleIdentifierProvider extends IdentifierProvider {
try { try {
handleService.createHandle(context, dso, identifier); handleService.createHandle(context, dso, identifier);
} catch (IllegalStateException | SQLException e) { } catch (IllegalStateException | SQLException e) {
log.error(LogHelper.getHeader(context, "Error while attempting to create handle", "Item id: " + dso.getID()), e); log.error(LogHelper.getHeader(context,
"Error while attempting to create handle",
"Item id: " + dso.getID()), e);
throw new RuntimeException("Error while attempting to create identifier for Item id: " + dso.getID()); throw new RuntimeException("Error while attempting to create identifier for Item id: " + dso.getID());
} }
} }
@@ -273,7 +275,9 @@ public class VersionedHandleIdentifierProvider extends IdentifierProvider {
} }
return handleId; return handleId;
} catch (SQLException | AuthorizeException e) { } catch (SQLException | AuthorizeException e) {
log.error(LogHelper.getHeader(context, "Error while attempting to create handle", "Item id: " + dso.getID()), e); log.error(LogHelper.getHeader(context,
"Error while attempting to create handle",
"Item id: " + dso.getID()), e);
throw new RuntimeException("Error while attempting to create identifier for Item id: " + dso.getID()); throw new RuntimeException("Error while attempting to create identifier for Item id: " + dso.getID());
} }
} }

View File

@@ -206,7 +206,9 @@ public class VersionedHandleIdentifierProviderWithCanonicalHandles extends Ident
} }
} }
} catch (IOException | SQLException | AuthorizeException e) { } catch (IOException | SQLException | AuthorizeException e) {
log.error(LogHelper.getHeader(context, "Error while attempting to create handle", "Item id: " + dso.getID()), e); log.error(LogHelper.getHeader(context,
"Error while attempting to create handle",
"Item id: " + dso.getID()), e);
throw new RuntimeException("Error while attempting to create identifier for Item id: " + dso.getID(), e); throw new RuntimeException("Error while attempting to create identifier for Item id: " + dso.getID(), e);
} }
} }
@@ -258,7 +260,9 @@ public class VersionedHandleIdentifierProviderWithCanonicalHandles extends Ident
try { try {
handleService.createHandle(context, dso, identifier); handleService.createHandle(context, dso, identifier);
} catch (IllegalStateException | SQLException e) { } catch (IllegalStateException | SQLException e) {
log.error(LogHelper.getHeader(context, "Error while attempting to create handle", "Item id: " + dso.getID()), e); log.error(LogHelper.getHeader(context,
"Error while attempting to create handle",
"Item id: " + dso.getID()), e);
throw new RuntimeException("Error while attempting to create identifier for Item id: " + dso.getID()); throw new RuntimeException("Error while attempting to create identifier for Item id: " + dso.getID());
} }
} }
@@ -291,7 +295,9 @@ public class VersionedHandleIdentifierProviderWithCanonicalHandles extends Ident
} }
return handleId; return handleId;
} catch (SQLException | AuthorizeException e) { } catch (SQLException | AuthorizeException e) {
log.error(LogHelper.getHeader(context, "Error while attempting to create handle", "Item id: " + dso.getID()), e); log.error(LogHelper.getHeader(context,
"Error while attempting to create handle",
"Item id: " + dso.getID()), e);
throw new RuntimeException("Error while attempting to create identifier for Item id: " + dso.getID()); throw new RuntimeException("Error while attempting to create identifier for Item id: " + dso.getID());
} }
} }
@@ -350,7 +356,9 @@ public class VersionedHandleIdentifierProviderWithCanonicalHandles extends Ident
} }
} }
} catch (RuntimeException | SQLException e) { } catch (RuntimeException | SQLException e) {
log.error(LogHelper.getHeader(context, "Error while attempting to register doi", "Item id: " + dso.getID()), e); log.error(LogHelper.getHeader(context,
"Error while attempting to register doi",
"Item id: " + dso.getID()), e);
throw new IdentifierException("Error while moving doi identifier", e); throw new IdentifierException("Error while moving doi identifier", e);
} }