Uploaded image for project: 'REEF (Retired)'
  1. REEF (Retired)
  2. REEF-1276

Improve error message shown when injectable class has [Parameter] annotation

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 0.15
    • Tang.NET
    • None

    Description

              [Inject]
              private PoisonedEventHandler(
                  [Parameter(typeof(CrashProbability))] double crashProbability,
                  [Parameter(typeof(CrashTimeout))] int crashTimeout,
                  [Parameter(typeof(RuntimeClock))] RuntimeClock clock) 
              {
                  ...
              }
      

      This code produces runtime error because RuntimeClock is not a primitive type and thus doesn't need an annotation. The error message is

      ERROR: Exception in Call_clrSystemAllocatedEvaluatorHandler_OnNext:encountered error [System.InvalidCastException: Unable to cast object of type 'Org.Apache.REEF.Tang.Implementations.ClassHierarchy.ClassNodeImpl' to type 'Org.Apache.REEF.Tang.Types.INamedParameterNode'.
         at Org.Apache.REEF.Tang.Implementations.ClassHierarchy.ClassHierarchyImpl.RegisterType(Type type)
         at Org.Apache.REEF.Tang.Implementations.ClassHierarchy.ClassHierarchyImpl.GetNode(Type type)
         at Org.Apache.REEF.Tang.Implementations.Configuration.CsConfigurationBuilderImpl.GetNode(Type c)
         at Org.Apache.REEF.Tang.Implementations.Configuration.CsConfigurationBuilderImpl.Org.Apache.REEF.Tang.Interface.ICsInternalConfigurationBuilder.BindSetEntry(Type iface, Type impl)
         at Org.Apache.REEF.Tang.Formats.ConfigurationModule.Build()
         at Org.Apache.REEF.Tests.Functional.FaultTolerant.PoisonTest.PoisonedEvaluatorDriver.OnNext(IAllocatedEvaluator value)
      

      It would be very nice to have something easier understandable, for example "Cannot interpret RuntimeClock as named parameter". Currently it takes a long time to figure out what exactly is wrong.

      Attachments

        Activity

          People

            dss-2009@yandex.ru Sergey Dudoladov
            MariiaMykhailova Mariia Mykhailova
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment