[BLOSSOM-101] TemplateDefinitionBuilder#resolveTemplateId throws IllegalStateException (with empty error string) when class is missing Template annotation Created: 13/Nov/12  Updated: 06/Dec/14  Resolved: 14/Nov/12

Status: Closed
Project: Blossom
Component/s: None
Affects Version/s: 2.0.1
Fix Version/s: 2.0.2

Type: Improvement Priority: Neutral
Reporter: Tomas Brimor Assignee: Tobias Mattsson
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relation
is related to BLOSSOM-96 Exception thrown when trying to expor... Closed
Template:
Acceptance criteria:
Empty
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)
Date of First Response:

 Description   

info.magnolia.module.blossom.template.TemplateDefinitionBuilder#resolveTemplateId throws IllegalStateException when class is missing Template annotation.

  • Why no error message? Looking at the code its seems very clear what the problem is, the error should communicate this?
  • I'm not sure the IllegalStateException is the best exception? Its description reads "Signals that a method has been invoked at an illegal or inappropriate time." A missing annotation is not really an issue regarding the timing of this call? Without the null check the actual exception would have been a NullPointerException, maybe catch that and re-throw it with an message explaining why it happened (related to the missing error message).


 Comments   
Comment by Tobias Mattsson [ 14/Nov/12 ]

Hi Tomas,

This has been reported as BLOSSOM-96 and subsequently fixed. The choice of exception is debatable yes, I'm changing it into an IllegalArgumentException.

Comment by Tomas Brimor [ 14/Nov/12 ]

Ah, sorry I missed that it had already been reported. Thanks for sorting it out.

Comment by Jan Haderka [ 06/Dec/14 ]

Bulk close of old resolved tickets.

Generated at Sun Feb 11 23:30:08 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.