Skip to content

Commit

Permalink
#13241 rethrow the original exception (#13416)
Browse files Browse the repository at this point in the history
  • Loading branch information
erickgonzalez authored and dsilvam committed Jan 18, 2018
1 parent 5742c18 commit 6b6da27
Show file tree
Hide file tree
Showing 54 changed files with 124 additions and 124 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,7 @@ protected Contentlet findContentletByIdentifier(String identifier, Boolean live,
return null;
}
catch (Exception e) {
throw new ElasticsearchException(e.getMessage());
throw new ElasticsearchException(e.getMessage(), e);

}
}
Expand Down Expand Up @@ -933,7 +933,7 @@ protected List<Contentlet> findContentletsByHost(String hostId, int limit, int o
}
return cons;
} catch (Exception e) {
throw new ElasticsearchException(e.getMessage());
throw new ElasticsearchException(e.getMessage(), e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2522,7 +2522,7 @@ public void relateContent(Contentlet contentlet, ContentletRelationshipRecords r
localTransaction = HibernateUtil.startLocalTransactionIfNeeded();
}
catch(Exception e){
throw new DotDataException(e.getMessage());
throw new DotDataException(e.getMessage(),e);
}

deleteRelatedContent(contentlet, related.getRelationship(), related.isHasParent(), user, respectFrontendRoles);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public boolean optimize(List<String> indexNames) {
+ " shards optimized");
return true;
} catch (Exception e) {
throw new ElasticsearchException(e.getMessage());
throw new ElasticsearchException(e.getMessage(),e);
}
}

Expand All @@ -256,7 +256,7 @@ public boolean delete(String indexName) {

return res.isAcknowledged();
} catch (Exception e) {
throw new ElasticsearchException(e.getMessage());
throw new ElasticsearchException(e.getMessage(),e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public void service(HttpServletRequest request, HttpServletResponse response) th
} catch (Exception e) {
Logger.error(this.getClass(), "Trying to invoke method:" + cmd);
Logger.error(this.getClass(), e.getMessage(), e.getCause());
throw new DotRuntimeException(e.getMessage());
throw new DotRuntimeException(e.getMessage(),e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ public Integer countQueueBundleIds() throws DotPublisherException {
}
catch(Exception e){
Logger.error(PublisherAPIImpl.class, e.getMessage());
throw new DotPublisherException(e.getMessage());
throw new DotPublisherException(e.getMessage(),e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void service(HttpServletRequest request, HttpServletResponse response) th
} catch (Exception e) {
Logger.error(this.getClass(), "Trying to invoke method:" + cmd);
Logger.error(this.getClass(), e.getMessage(), e.getCause());
throw new DotRuntimeException(e.getMessage());
throw new DotRuntimeException(e.getMessage(),e);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void service(HttpServletRequest request, HttpServletResponse response) th
} catch (Exception e) {
Logger.error(this.getClass(), "Trying to invoke method:" + cmd);
Logger.error(this.getClass(), e.getMessage(), e.getCause());
throw new DotRuntimeException(e.getMessage());
throw new DotRuntimeException(e.getMessage(),e);
}
}
}
Expand Down Expand Up @@ -150,7 +150,7 @@ public void addEnvironment(HttpServletRequest request, HttpServletResponse respo

} catch (DotDataException e) {
Logger.info(getClass(), e.getMessage());
throw new DotRuntimeException(e.getMessage());
throw new DotRuntimeException(e.getMessage(),e);
}
}

Expand Down Expand Up @@ -222,7 +222,7 @@ public void editEnvironment(HttpServletRequest request, HttpServletResponse resp

} catch (DotDataException e) {
Logger.info(getClass(), e.getMessage());
throw new DotRuntimeException(e.getMessage());
throw new DotRuntimeException(e.getMessage(),e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,10 @@ public PublisherConfig process ( final PublishStatus status ) throws DotPublishi
PushPublishLogger.log(this.getClass(), "Status Update: Failed to publish");
pubAuditAPI.updatePublishAuditStatus(this.config.getId(), PublishAuditStatus.Status.FAILED_TO_PUBLISH, currentStatusHistory);
} catch (DotPublisherException e1) {
throw new DotPublishingException(e.getMessage());
throw new DotPublishingException(e.getMessage(),e);
}
Logger.error(this.getClass(), e.getMessage(), e);
throw new DotPublishingException(e.getMessage());
throw new DotPublishingException(e.getMessage(),e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public InputStream buildStream(IHTMLPage htmlPage, PageMode mode, final String f
return buildStream(htmlPage, identifier, mode, filePath);
} catch (Exception e) {
Logger.error(this.getClass(), e.getMessage(), e);
throw new DotRuntimeException(e.getMessage());
throw new DotRuntimeException(e.getMessage(),e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ private static class Holder {

} catch (Exception e) {
Logger.error(TranslationUtil.class, e.getMessage(), e);
throw new DotStateException(e.getMessage());
throw new DotStateException(e.getMessage(),e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ protected void saveVersionInfo(VersionInfo info, boolean updateVersionTS) throws
try {
BeanUtils.copyProperties(vi, info);
} catch (Exception e) {
throw new DotDataException(e.getMessage());
throw new DotDataException(e.getMessage(),e);
}

if(updateVersionTS) {
Expand Down Expand Up @@ -317,7 +317,7 @@ protected void saveContentletVersionInfo(ContentletVersionInfo cvInfo, boolean u
try {
BeanUtils.copyProperties(vi, cvInfo);
} catch (Exception e) {
throw new DotDataException(e.getMessage());
throw new DotDataException(e.getMessage(),e);
}
if(updateVersionTS){
vi.setVersionTs(new Date());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,23 +62,23 @@ public synchronized ClickstreamConfig getConfig() {
}
catch (SAXException e) {
Logger.fatal(ConfigLoader.class, "Could not parse config XML", e);
throw new RuntimeException(e.getMessage());
throw new RuntimeException(e.getMessage(),e);
}
catch (IOException e) {
Logger.fatal(ConfigLoader.class, "Could not read config from stream", e);
throw new RuntimeException(e.getMessage());
throw new RuntimeException(e.getMessage(),e);
}
catch (ParserConfigurationException e) {
Logger.fatal(ConfigLoader.class, "Could not obtain SAX parser", e);
throw new RuntimeException(e.getMessage());
throw new RuntimeException(e.getMessage(),e);
}
catch (RuntimeException e) {
Logger.fatal(ConfigLoader.class, "RuntimeException", e);
throw e;
}
catch (Throwable e) {
Logger.fatal(ConfigLoader.class, "Exception", e);
throw new RuntimeException(e.getMessage());
throw new RuntimeException(e.getMessage(),e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,7 @@ public static boolean startLocalTransactionIfNeeded() throws DotDataException{
}
} catch (SQLException e) {
Logger.error(HibernateUtil.class,e.getMessage(),e);
throw new DotDataException(e.getMessage());
throw new DotDataException(e.getMessage(),e);
}
return startTransaction;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private void doFilterInternal(ServletRequest req, ServletResponse res, FilterCha

} catch (DotDataException e) {
Logger.error(CMSFilter.class, e.getMessage(), e);
throw new IOException(e.getMessage());
throw new IOException(e.getMessage(),e);
}
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ protected void _viewWebAssets(RenderRequest req, User user, Class className, Str
} catch (Exception e) {
req.setAttribute(viewWebKey, results);
Logger.error(this, "Exception e =" + e.getMessage(), e);
throw new Exception(e.getMessage());
throw new Exception(e.getMessage(),e);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ public void saveFileAction(String selectedItem,String wfActionAssign,String wfAc

} catch (Exception e) {
Logger.error(BrowserAjax.class, e.getMessage(), e);
throw new ServletException(e.getMessage());
throw new ServletException(e.getMessage(),e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -992,7 +992,7 @@ public Map<String, Object> disconnectEvent(String inode,String startDateStr, Str
autoCom = DbConnectionFactory.getConnection().getAutoCommit();
}
catch(Exception e){
throw new DotDataException(e.getMessage());
throw new DotDataException(e.getMessage(),e);
}
if(autoCom){
HibernateUtil.startTransaction();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ public void saveContainerStructures(final List<ContainerStructure> containerStru
CacheLocator.getContainerCache().remove(containerIdentifier);
CacheLocator.getContentTypeCache().addContainerStructures(containerStructureList, containerIdentifier, containerInode);
} catch(DotHibernateException e){
throw new DotDataException(e.getMessage());
throw new DotDataException(e.getMessage(),e);

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ private void _deleteChildrenAssetsFromFolder(Folder folder, User user, boolean r

} catch (Exception e) {
Logger.error(FolderAPI.class, e.getMessage(), e);
throw new DotStateException(e.getMessage());
throw new DotStateException(e.getMessage(),e);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ protected Folder findFolderByPath(String path, Host host) throws DotDataExceptio
}
}
catch(Exception e){
throw new DotDataException(e.getMessage());
throw new DotDataException(e.getMessage(),e);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ protected void _loadStructures(RenderRequest req, User user, String countWebKey,
} catch (Exception e) {
req.setAttribute(viewWebKey, structures);
Logger.error(this, "Exception e =" + e.getMessage(), e);
throw new Exception(e.getMessage());
throw new Exception(e.getMessage(),e);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public Map<String, Object> getPageStatistics(String htmlPageIdentifier, Date sta

} catch (Exception e) {
Logger.error(this, e.getMessage(), e);
throw new DotRuntimeException(e.getMessage());
throw new DotRuntimeException(e.getMessage(),e);
}

return results;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ protected void _loadStructures(RenderRequest req, User user, String countWebKey,
Logger.error(this,
String.format("An error occurred when retrieving Content types: type=[%d], query=[%s] : ",
contentTypeBaseType, query) + e.getMessage(), e);
throw new Exception(e.getMessage());
throw new Exception(e.getMessage(),e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ public static List<Structure> getStructuresUnderHost(Host h, User user, boolean
}
catch(Exception e){
Logger.error(StructureFactory.class, e.getMessage(), e);
throw new DotDataException(e.getMessage());
throw new DotDataException(e.getMessage(),e);

}
}
Expand All @@ -340,7 +340,7 @@ public static List<Structure> getStructuresByWFScheme(WorkflowScheme scheme, Use
}
catch(Exception e){
Logger.error(StructureFactory.class, e.getMessage(), e);
throw new DotDataException(e.getMessage());
throw new DotDataException(e.getMessage(),e);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public void executeAction(WorkflowProcessor processor,Map<String,WorkflowActionC

} catch (Exception e) {
Logger.error(this.getClass(),e.getMessage(),e);
throw new WorkflowActionFailureException(e.getMessage());
throw new WorkflowActionFailureException(e.getMessage(),e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void executeAction(WorkflowProcessor processor,Map<String,WorkflowActionC
APILocator.getContentletAPI().unlock(processor.getContentlet(), processor.getUser(), true);
} catch (Exception e) {
Logger.error(this.getClass(),e.getMessage(),e);
throw new WorkflowActionFailureException(e.getMessage());
throw new WorkflowActionFailureException(e.getMessage(),e);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void executeAction(WorkflowProcessor processor,Map<String,WorkflowActionC
APILocator.getContentletAPI().lock(processor.getContentlet(), processor.getUser(), true);
} catch (Exception e) {
Logger.error(this.getClass(),e.getMessage(),e);
throw new WorkflowActionFailureException(e.getMessage());
throw new WorkflowActionFailureException(e.getMessage(),e);

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void executeAction(WorkflowProcessor processor, Map<String, WorkflowActio
processor.setContentlet(null);
} catch (Exception e) {
Logger.error(this.getClass(),e.getMessage(),e);
throw new WorkflowActionFailureException(e.getMessage());
throw new WorkflowActionFailureException(e.getMessage(),e);

}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void executeAction(WorkflowProcessor processor, Map<String, WorkflowActio

} catch (Exception e) {
Logger.error(PublishContentActionlet.class, e.getMessage(), e);
throw new WorkflowActionFailureException(e.getMessage());
throw new WorkflowActionFailureException(e.getMessage(),e);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ public void executeAction(WorkflowProcessor processor, Map<String, WorkflowActio

} catch (DotPublisherException e) {
Logger.debug(PushPublishActionlet.class, e.getMessage());
throw new WorkflowActionFailureException(e.getMessage());
throw new WorkflowActionFailureException(e.getMessage(),e);
} catch (DotDataException e) {
Logger.debug(PushPublishActionlet.class, e.getMessage());
throw new WorkflowActionFailureException(e.getMessage());
throw new WorkflowActionFailureException(e.getMessage(),e);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ public void executeAction(WorkflowProcessor processor, Map<String, WorkflowActio
}
} catch (DotPublisherException e) {
Logger.debug(PushPublishActionlet.class, e.getMessage());
throw new WorkflowActionFailureException(e.getMessage());
throw new WorkflowActionFailureException(e.getMessage(),e);
} catch (ParseException e){
Logger.debug(PushPublishActionlet.class, e.getMessage());
throw new WorkflowActionFailureException(e.getMessage());
throw new WorkflowActionFailureException(e.getMessage(),e);
} catch (DotDataException e) {
Logger.debug(PushPublishActionlet.class, e.getMessage());
throw new WorkflowActionFailureException(e.getMessage());
throw new WorkflowActionFailureException(e.getMessage(),e);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void executeAction(final WorkflowProcessor processor,
} catch (Exception e) {

Logger.error(this.getClass(),e.getMessage(),e);
throw new WorkflowActionFailureException(e.getMessage());
throw new WorkflowActionFailureException(e.getMessage(),e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void executeAction(final WorkflowProcessor processor,
} catch (Exception e) {

Logger.error(this.getClass(),e.getMessage(),e);
throw new WorkflowActionFailureException(e.getMessage());
throw new WorkflowActionFailureException(e.getMessage(),e);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void executePreAction(WorkflowProcessor processor, Map<String, WorkflowAc
finalValue = ctx.get("value");

} catch (Exception e) {
throw new WorkflowActionFailureException(e.getMessage());
throw new WorkflowActionFailureException(e.getMessage(),e);
}

}
Expand Down
Loading

0 comments on commit 6b6da27

Please sign in to comment.