Update ReportingController.java
Perbaikan handling exception file LIS tidak ditemukan
This commit is contained in:
parent
75abeb5471
commit
31248cacb4
@ -16,6 +16,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.NoSuchFileException;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@ -120,6 +121,8 @@ public class ReportingController {
|
||||
while ((nRead = inputStream.read()) != -1) {
|
||||
response.getWriter().write(nRead);
|
||||
}
|
||||
} catch (NoSuchFileException ex) {
|
||||
response.setStatus(HttpServletResponse.SC_NOT_FOUND);
|
||||
} catch (Exception var15) {
|
||||
System.out.println(var15.getMessage());
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user