Skip to content

Commit

Permalink
Add better exception handling when..
Browse files Browse the repository at this point in the history
..http server initialization failed.
  • Loading branch information
Wastack committed Jun 23, 2020
1 parent 7edef8d commit c9dcfa8
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -385,14 +385,15 @@ private Set<String> findOldFlowFileIds(final ProcessContext ctx) {
}

@Override
public void onTrigger(final ProcessContext context, final ProcessSessionFactory sessionFactory) {
public void onTrigger(final ProcessContext context, final ProcessSessionFactory sessionFactory) throws ProcessException {
try {
if (!initialized.get()) {
createHttpServerFromService(context);
}
} catch (Exception e) {
getLogger().warn("Failed to start http server during initialization: " + e);
context.yield();
throw new ProcessException("Failed to initialize the server", e);
}

sessionFactoryReference.compareAndSet(null, sessionFactory);
Expand Down

0 comments on commit c9dcfa8

Please sign in to comment.