Github user pvillard31 commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/1107#discussion_r82070839
  
    --- Diff: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/StandardProcessorNode.java
 ---
    @@ -187,6 +187,50 @@ public StandardProcessorNode(final Processor 
processor, final String uuid,
             }
     
             schedulingStrategy = SchedulingStrategy.TIMER_DRIVEN;
    +        try
    +        {
    +
    +            if(procClass.isAnnotationPresent(DefaultSchedule.class))
    +            {
    +                DefaultSchedule dsc = 
procClass.getAnnotation(DefaultSchedule.class);
    +                try
    +                {
    +                    this.setSchedulingStrategy(dsc.Strategy());
    +                }
    +                catch (Throwable ex)
    +                {
    +                    LOG.error(String.format("Error while setting 
scheduling strategy from DefaultSchedule annotation: %s",ex.getMessage()));
    --- End diff --
    
    When logging exceptions, you could add the exception as second argument of 
the logging method, this will display the full stacktrace in the logs and that 
can be quite useful.
    ````java
    LOG.error(String.format("Error while setting scheduling strategy from 
DefaultSchedule annotation: %s",ex.getMessage()), ex);
    ````


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to