Github user geomacy commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/790#discussion_r131354907
--- Diff: core/src/main/java/org/apache/brooklyn/feed/http/HttpFeed.java ---
@@ -228,6 +235,25 @@ public Builder httpExecutor(HttpExecutor val) {
this.httpExecutor = val;
return this;
}
+ public Map<String, String> buildBaseHeaders() {
+ if (Boolean.TRUE.equals(preemptiveBasicAuth)) {
+ Credentials creds = credentials;
+ if (creds == null) {
+ throw new IllegalArgumentException("Must not enable
preemptiveBasicAuth when there are no credentials, in feed for "+baseUri);
--- End diff --
I tend to find the more-situation-specific Exceptions most useful from the
developer point of view, as it can be handy to add breakpoints on specific
types when debugging; if you want to break when the exception is thrown it can
sometimes be a bother to set it on the more generic type, as it may get thrown
in other places.
I agree there's no compelling reason to change the
`IllegalArgumentException` here, however. A separate discussion could be had
about possible more useful base exceptions.
`IllegalBrooklynConfigurationException`, anyone? :-)
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---