Browse files

Added a friendly exception message

  • Loading branch information...
1 parent 289c04e commit 0c71e5bc012bac4d19f7a4a9bf954cc446318298 @kabturek kabturek committed with judofyr Nov 15, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/tilt/template.rb
View
3 lib/tilt/template.rb
@@ -59,7 +59,8 @@ def initialize(file=nil, line=1, options={}, &block)
when arg.respond_to?(:to_hash) ; @options = arg.to_hash.dup
when arg.respond_to?(:path) ; @file = arg.path
when arg.respond_to?(:to_path) ; @file = arg.to_path
- else raise TypeError
+ else raise TypeError, "Can't load the template file. Pass a string with a path " +
+ "or an object that responds to 'to_str', 'path' or 'to_path'"
end
end

0 comments on commit 0c71e5b

Please sign in to comment.