Skip to content

Commit

Permalink
Provide the URI as part of the error message when object recreation i…
Browse files Browse the repository at this point in the history
…s attempted
  • Loading branch information
jcoyne committed Jan 6, 2015
1 parent 63e9aed commit 7e8dd02
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/active_fedora/core.rb
Expand Up @@ -36,7 +36,7 @@ def ldp_source
def initialize(attributes_or_resource_or_url = nil, &block)
init_internals
attributes = initialize_resource_and_attributes(attributes_or_resource_or_url)
raise IllegalOperation, "Attempting to recreate existing ldp_source" unless ldp_source.new?
raise IllegalOperation, "Attempting to recreate existing ldp_source: `#{ldp_source.subject}'" unless ldp_source.new?
assert_content_model
load_attached_files
self.attributes = attributes if attributes
Expand Down
2 changes: 1 addition & 1 deletion spec/integration/base_spec.rb
Expand Up @@ -46,7 +46,7 @@ class MockAFBaseRelationship < ActiveFedora::Base
end
describe "when trying to create it again" do
it "should raise an error" do
expect { MockAFBaseRelationship.create(id: @release.id) }.to raise_error(ActiveFedora::IllegalOperation)
expect { MockAFBaseRelationship.create(id: @release.id) }.to raise_error(ActiveFedora::IllegalOperation, "Attempting to recreate existing ldp_source: `#{@release.uri}'")
@release.reload
expect(@release.foo.person).to include('test foo content')
end
Expand Down

0 comments on commit 7e8dd02

Please sign in to comment.