Exception: Wings::Valkyrie::Persister::MissingOrUnsavedFileError

Inherits:
FailedSaveError
  • Object
show all
Defined in:
lib/wings/valkyrie/persister.rb

Instance Attribute Summary

Attributes inherited from FailedSaveError

#obj

Instance Method Summary collapse

Constructor Details

#initialize(msg = nil, obj:) ⇒ MissingOrUnsavedFileError

Returns a new instance of MissingOrUnsavedFileError.


83
84
85
86
87
88
89
90
91
# File 'lib/wings/valkyrie/persister.rb', line 83

def initialize(msg = nil, obj:)
  msg = "Wings tried to save metadata for a file which has not " \
        "been saved. Fedora creates a metadata node when the file is " \
        "created, so it's not possible to add metadata for a file " \
        "until the file contents are persisted.\n  Use the " \
        "Hyrax.storage_adapter to save the file before trying to " \
        "save metadata.\n" + msg
  super(msg, obj: obj)
end