关于exception异常Thorw 被吃掉的问题

@Override
    public List<GDocument> getDocumentsCURL(List<GDocument> documents)
            throws ServiceException {
        DocumentAction docAction = new DocumentAction(this
                .getServletReuqest(), this.getServletResponse(), this
                .getServletContext());
        List<GDocument> gDocs=null;
        try {
            gDocs=docAction.getDocumentsCURL(documents);
        } catch (QuetzacoException e) {
            // TODO Auto-generated catch block

            //打印异常信息
            e.printStackTrace();
            //如果这里不做处理(不写这句话 throw new ServiceException(e.getErrorCode());)就相当于被吃掉,
                没有抛到上一层去捕获。上一层会出现错误,或者在此处就做处理、
            throw new ServiceException(e.getErrorCode());
        }
        return gDocs;
    }
业勤于精荒于嬉 http://www.cnblogs.com/maxlei/
原文地址:https://www.cnblogs.com/maxlei/p/5954102.html