aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/src/main/java/fi/iki/elonen/NanoHTTPD.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/core/src/main/java/fi/iki/elonen/NanoHTTPD.java b/core/src/main/java/fi/iki/elonen/NanoHTTPD.java
index 38e023d..06b9318 100644
--- a/core/src/main/java/fi/iki/elonen/NanoHTTPD.java
+++ b/core/src/main/java/fi/iki/elonen/NanoHTTPD.java
@@ -1211,7 +1211,7 @@ public abstract class NanoHTTPD {
dest.write(src.slice());
path = tempFile.getName();
} catch (Exception e) { // Catch exception if any
- System.err.println("Error: " + e.getMessage());
+ throw new Error(e); // we won't recover, so throw an error
} finally {
safeClose(fileOutputStream);
}
@@ -1224,9 +1224,8 @@ public abstract class NanoHTTPD {
TempFile tempFile = tempFileManager.createTempFile();
return new RandomAccessFile(tempFile.getName(), "rw");
} catch (Exception e) {
- System.err.println("Error: " + e.getMessage());
+ throw new Error(e); // we won't recover, so throw an error
}
- return null;
}
/**