Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d682b20

Browse files
committedMar 19, 2015
Give complete info on bad compiler option value
1 parent 2fb50a5 commit d682b20

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

Diff for: ‎lib/opal/compiler.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ def self.compiler_option(name, default_value, options = {})
5454
valid_values = options[:valid_values]
5555
define_method(mid || name) do
5656
value = @options.fetch(name) { default_value }
57-
raise ArgumentError if valid_values and not(valid_values.include?(value))
57+
if valid_values and not(valid_values.include?(value))
58+
raise ArgumentError, "invalid option value: #{value.inspect} (valid values: #{values.inspect})"
59+
end
5860
value
5961
end
6062
end

0 commit comments

Comments
 (0)
Please sign in to comment.