aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/lib
diff options
context:
space:
mode:
authorGeorge Claghorn <george.claghorn@gmail.com>2018-08-06 22:01:21 -0400
committerGitHub <noreply@github.com>2018-08-06 22:01:21 -0400
commit1ed33a2a64f09182287c4bb283e574aad959126f (patch)
tree955033c82128a98024294e002dc90f4d11491728 /activestorage/lib
parent53ec6cdf7ade942b2589bf8295246f7bc98c850a (diff)
parent3082786be616173f28488e89b7d8b9bfc5cd0f97 (diff)
downloadrails-1ed33a2a64f09182287c4bb283e574aad959126f.tar.gz
rails-1ed33a2a64f09182287c4bb283e574aad959126f.tar.bz2
rails-1ed33a2a64f09182287c4bb283e574aad959126f.zip
Merge pull request #33540 from joeltaylor/improve_service_adapter_error_handling
Improve ActiveStorage service adapter error handling
Diffstat (limited to 'activestorage/lib')
-rw-r--r--activestorage/lib/active_storage/service/configurator.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/activestorage/lib/active_storage/service/configurator.rb b/activestorage/lib/active_storage/service/configurator.rb
index 39951fd026..32fa9105c6 100644
--- a/activestorage/lib/active_storage/service/configurator.rb
+++ b/activestorage/lib/active_storage/service/configurator.rb
@@ -26,7 +26,9 @@ module ActiveStorage
def resolve(class_name)
require "active_storage/service/#{class_name.to_s.underscore}_service"
- ActiveStorage::Service.const_get(:"#{class_name}Service")
+ ActiveStorage::Service.const_get(:"#{class_name.classify}Service")
+ rescue LoadError
+ raise "Missing service adapter for #{class_name.inspect}"
end
end
end