transloadit/rails-sdk

Better error message when config loading fails

felixge opened this issue · 2 comments

Something went wrong when loading my config, and I got:

NoMethodError in Uploads#index

Showing /Users/felix/Desktop/transloadit-test/app/views/uploads/index.html.erb where line #2 raised:

You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.[]

Extracted source (around line #2):

1: <%= form_for :thing, :html => { :id => 'upload' } do |form| %>
2:   <%= form.transloadit :my_template %>
3:   <%= form.file_field :file, 'File to upload' %>
4: <% end %>
5: 

Rails.root: /Users/felix/Desktop/transloadit-test

Turning this into a more helpful message would be great.

Now it says

key not found: "#{template}"

Awesome. thanks!