[MAGNOLIA-8198] Error handling for MicroProfile API Created: 04/Mar/21  Updated: 30/Sep/21  Resolved: 16/Mar/21

Status: Closed
Project: Magnolia
Component/s: None
Affects Version/s: None
Fix Version/s: 6.3.0

Type: Improvement Priority: Neutral
Reporter: Andrei Ichimescu Assignee: Andrei Ichimescu
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
[X]* handle NPE exceptions
[X]* handle Class cast exceptions
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Documentation update required:
Yes
Date of First Response:
Epic Link: System configuration restrictions and externalisation
Story Points: 2

 Description   

As a devops/dev user I want to receive a clear message with the proper error when a config property is missing or if a property cannot be mapped to an injected field using MicroProfile API.



 Comments   
Comment by Jesus Alonso [ 17/Mar/21 ]

When a mandatory is not present, I see an error such as

1) Error injecting info.magnolia.external.dam.s3.cloud.DamS3CloudModule using info.magnolia.objectfactory.guice.microprofile.MicroProfileConfigSupportModule$ConfigPropertiesInjector@7c80ede9.
 Reason: info.magnolia.objectfactory.guice.microprofile.resolver.PropertyResolverException: Error while trying to resolve config property with the key: magnolia.dam.bucketName. The key is missing and there is no defaultValue present in the @ConfigProperty annotation. 
Generated at Mon Feb 12 04:30:31 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.