Throw error on non-existent coldbox DSL

Description

If you try to inject a non-existent coldbox DSL you will just get NULL back.

property name="foo" inject="coldbox:foobar";

This fails to alert the developer of their mistake in a useful way. The code will probably still error, but just downstream in some other unpredictable way.

The ColdBoxDSL builder logs a message with LogBox in this scenario, but I would suggest that it throw an error instead. If a DSL is asked for that can't be resolved, I think that's a fatal condition that needs to halt processing.

A better solution to throwing an error from ColdBoxDSL would be to rearrange the logic a bit in Builder.cfc's buildDSLDependency() method. There is already a check and a throw if the DSL doesn't produce a dependency at the bottom, but custom DSL builders skip that check since they just return.

Gliffy Diagrams

Activity

Show:
Fixed
Pinned fields
Click on the next to a field label to start pinning.

Details

Assignee

Reporter

Original estimate

Time tracking

No time logged1h remaining

Components

Fix versions

Priority

Sentry

Created December 24, 2014 at 1:13 AM
Updated April 28, 2017 at 6:19 AM
Resolved March 24, 2017 at 2:27 AM