Skip to content
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

Merged
merged 1 commit into from
Jan 13, 2015

Conversation

hectorcorrea
Copy link
Member

Addresses issue #656

@@ -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"
Copy link
Member

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"

@jcoyne
Copy link
Member

jcoyne commented Jan 13, 2015


it "should connect OK" do
expect(ActiveFedora::Base.logger).to_not receive(:warn)
ActiveFedora::Fedora.new(:url => good_url, :base_path => '/test')
Copy link
Member

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!)

Copy link
Member Author

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]

@jcoyne
Copy link
Member

jcoyne commented Jan 13, 2015

Another way to do this would be to get the resource at host and see if it is returning an RDF graph.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) when pulling 096f8ba on warn_on_bad_fedora_url into 8852da7 on master.

@mjgiarlo
Copy link
Member

@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.

@jcoyne
Copy link
Member

jcoyne commented Jan 13, 2015

@mjgiarlo this ticket addresses #656, you are bringing up issue #680

@hectorcorrea
Copy link
Member Author

@mjgiarlo @jcoyne I am not to worried about users tweaking the web.xml because as Mike pointed out the warning is only raised if the connection fails. I suspect users that intentionally update the Fedora settings will know what to make out of the warning.

@mjgiarlo
Copy link
Member

w00t, 🚀 is 💣

jcoyne added a commit that referenced this pull request Jan 13, 2015
Warn user when initial connection to Fedora fails and the URL does not e...
@jcoyne jcoyne merged commit 158299d into master Jan 13, 2015
@coveralls
Copy link

Coverage Status

Coverage increased (+0.05%) when pulling cba91e1 on warn_on_bad_fedora_url into 8852da7 on master.

@flyingzumwalt
Copy link
Member

👍 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants