diff --git a/src/main/java/com/github/zxbu/webdavteambition/filter/ErrorFilter.java b/src/main/java/com/github/zxbu/webdavteambition/filter/ErrorFilter.java index 17383f4..586edf9 100644 --- a/src/main/java/com/github/zxbu/webdavteambition/filter/ErrorFilter.java +++ b/src/main/java/com/github/zxbu/webdavteambition/filter/ErrorFilter.java @@ -66,7 +66,10 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha httpServletResponse.flushBuffer(); } catch (Throwable t) { httpServletResponse.setStatus(500); - httpServletResponse.getWriter().write(t.getMessage()); + try { + httpServletResponse.getWriter().write(String.valueOf(t.getMessage())); + } catch (Throwable ignore) { + } httpServletResponse.flushBuffer(); } } diff --git a/src/main/java/net/sf/webdav/methods/DoGet.java b/src/main/java/net/sf/webdav/methods/DoGet.java index ad5dbca..3d17f94 100644 --- a/src/main/java/net/sf/webdav/methods/DoGet.java +++ b/src/main/java/net/sf/webdav/methods/DoGet.java @@ -36,6 +36,7 @@ import net.sf.webdav.WebdavStatus; import net.sf.webdav.locking.ResourceLocks; import org.apache.commons.io.IOUtils; +import org.eclipse.jetty.io.EofException; public class DoGet extends DoHead { @@ -79,13 +80,12 @@ protected void doBody(ITransaction transaction, HttpServletResponse resp, IOUtils.closeQuietly(in); try { bos.flush(); - } catch (Exception e) { - LOG.warn("{} Flushing OutputStream causes Exception!\n", path - ,e); + } catch (Exception ignored) { } IOUtils.closeQuietly(bos); IOUtils.closeQuietly(out); } + } catch (EofException ignore) { } catch (Exception e) { LOG.warn("{} doBody causes Exception!\n", path ,e);