Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: command parameter injection service (#1526)
### Motivation When trying to execute specific commands, such as `version installtemplate`, an exception is thrown due to a wrong implementation of the cloud command injection service: ``` [10.10 20:55:49.130] ERROR: Exception during command execution org.incendo.cloud.exception.InjectionException: Failed to inject type org.incendo.cloud.context.CommandContext<?> at org.incendo.cloud.injection.ParameterInjectorRegistry.getInjectable(ParameterInjectorRegistry.java:197) at org.incendo.cloud.annotations.method.AnnotatedMethodHandler.getInjectedValue(AnnotatedMethodHandler.java:135) at org.incendo.cloud.annotations.method.AnnotatedMethodHandler.createParameterValues(AnnotatedMethodHandler.java:206) ... Caused by: org.incendo.cloud.services.PipelineException: Failed to retrieve result from ServiceWrapper{type=org.incendo.cloud.injection.InjectionService<C>,implementation=eu.cloudnetservice.node.command.defaults.AerogelInjectionService} at org.incendo.cloud.services.ServiceSpigot.complete(ServiceSpigot.java:97) at org.incendo.cloud.injection.ParameterInjectorRegistry.getInjectable(ParameterInjectorRegistry.java:178) ... 13 common frames omitted ``` ### Modification Change the injection service so that it no longer throws an exception but rather returns null as required if an instance of the requested type cannot be injected. ### Result The execution of specific commands no longer throws an exception and works as expected again.
- Loading branch information