Commit 57b2d64c authored by Rolf Krahl's avatar Rolf Krahl

Catch IllegalArgumentException from mainStorage.put(). Ref. icatproject/ids.plugin#8.

parent 233f7f9b
......@@ -1723,7 +1723,12 @@ public class IdsBean {
CRC32 crc = new CRC32();
CheckedWithSizeInputStream is = new CheckedWithSizeInputStream(body, crc);
String location = mainStorage.put(dsInfo, name, is);
String location;
try {
location = mainStorage.put(dsInfo, name, is);
} catch (IllegalArgumentException e) {
throw new BadRequestException("Illegal filename or dataset: " + e.getMessage());
long checksum = crc.getValue();
long size = is.getSize();
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment