mirror of
https://github.com/DSpace/DSpace.git
synced 2025-10-17 06:53:09 +00:00
Mention bitstream ID in exception for better debugging. (3061)
This commit is contained in:
@@ -45,7 +45,8 @@ public class BitstreamServiceImpl extends DSpaceObjectServiceImpl<Bitstream> imp
|
|||||||
/**
|
/**
|
||||||
* log4j logger
|
* log4j logger
|
||||||
*/
|
*/
|
||||||
private static Logger log = org.apache.logging.log4j.LogManager.getLogger(BitstreamServiceImpl.class);
|
private static final Logger log
|
||||||
|
= org.apache.logging.log4j.LogManager.getLogger();
|
||||||
|
|
||||||
|
|
||||||
@Autowired(required = true)
|
@Autowired(required = true)
|
||||||
@@ -350,7 +351,8 @@ public class BitstreamServiceImpl extends DSpaceObjectServiceImpl<Bitstream> imp
|
|||||||
public void expunge(Context context, Bitstream bitstream) throws SQLException, AuthorizeException {
|
public void expunge(Context context, Bitstream bitstream) throws SQLException, AuthorizeException {
|
||||||
authorizeService.authorizeAction(context, bitstream, Constants.DELETE);
|
authorizeService.authorizeAction(context, bitstream, Constants.DELETE);
|
||||||
if (!bitstream.isDeleted()) {
|
if (!bitstream.isDeleted()) {
|
||||||
throw new IllegalStateException("Bitstream must be deleted before it can be removed from the database");
|
throw new IllegalStateException("Bitstream " + bitstream.getID().toString()
|
||||||
|
+ " must be deleted before it can be removed from the database.");
|
||||||
}
|
}
|
||||||
bitstreamDAO.delete(context, bitstream);
|
bitstreamDAO.delete(context, bitstream);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user