关于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;
    }

 

posted @ 2016-10-12 19:08  神经质攻城狮马磊  阅读(539)  评论(0编辑  收藏  举报