-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warn user when initial connection to Fedora fails and the URL does not e... #684
Conversation
@@ -26,6 +26,9 @@ def init_base_path | |||
ActiveFedora::Base.logger.info "Attempted to init base path `#{root_resource_path}`, but it already exists" if ActiveFedora::Base.logger | |||
return false | |||
rescue Ldp::NotFound | |||
if !host.downcase.end_with?("/rest") | |||
ActiveFedora::Base.logger.warn "Fedora URL (#{host}) does not end with /rest. This could be the problem. Check your fedora.yml config" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switch "This could be the problem" to "This could be a problem"
This assumes they will never modify https://github.com/fcrepo4/fcrepo4/blob/3bfc11f2a3088f7435e47268faafb4f000ae50c0/fcrepo-webapp/src/main/webapp/WEB-INF/web.xml#L33 is that a safe assumption? |
|
||
it "should connect OK" do | ||
expect(ActiveFedora::Base.logger).to_not receive(:warn) | ||
ActiveFedora::Fedora.new(:url => good_url, :base_path => '/test') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use Ruby 1.9-style hashes, pls, good sir. (Kill the hashrockets!)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mjgiarlo They are now gone [insert sad 🚀 here]
Another way to do this would be to get the resource at |
@jcoyne I'm not too concerned about the web.xml thing, because the warning only appears when an LDP error is raised, and the message is merely a suggestion about what might be an easy mistake to make for folks new to F4. Though I wonder if another quick check might be taking a glance at the base_path value and making sure it exists? That's tripped one or two of us up already. |
096f8ba
to
cba91e1
Compare
w00t, 🚀 is 💣 |
Warn user when initial connection to Fedora fails and the URL does not e...
👍 😉 |
Addresses issue #656