Commit 8bda5ba4 authored by Stan Hu's avatar Stan Hu

Add context to object storage error message

If object storage is not enabled for a certain type of object, project
exports may see "Object storage is not enabled". It's hard to know what
type of object is not enabled, so add the class name of the uploader to
see.

This came out of an attempt to run the project export in Kubernetes.
parent 25fddbf4
...@@ -394,7 +394,7 @@ module ObjectStorage ...@@ -394,7 +394,7 @@ module ObjectStorage
def storage_for(store) def storage_for(store)
case store case store
when Store::REMOTE when Store::REMOTE
raise 'Object Storage is not enabled' unless self.class.object_store_enabled? raise "Object Storage is not enabled for #{self.class}" unless self.class.object_store_enabled?
CarrierWave::Storage::Fog.new(self) CarrierWave::Storage::Fog.new(self)
when Store::LOCAL when Store::LOCAL
......
...@@ -272,7 +272,7 @@ describe ObjectStorage do ...@@ -272,7 +272,7 @@ describe ObjectStorage do
end end
it "to raise an error" do it "to raise an error" do
expect { subject }.to raise_error(/Object Storage is not enabled/) expect { subject }.to raise_error(/Object Storage is not enabled for JobArtifactUploader/)
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment