Permalink
Browse files

By providing the binding and filename, if an exception is thrown with…

…in eval, it will show the proper backtrace rather than saying it just originated within eval()
  • Loading branch information...
1 parent ecd43f8 commit afb9f27439676948bea9cf2f455c5a3a35bd1b13 @mikelewis mikelewis committed May 1, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/goliath/server.rb
View
@@ -114,7 +114,8 @@ def load_config(file = nil)
file ||= "#{config_dir}/#{api_name}.rb"
return unless File.exists?(file)
- eval(IO.read(file))
+ proc = Proc.new {} # create proc to grab binding
+ eval(IO.read(file), proc.binding, file)
end
# Retrieves the configuration directory for the server

0 comments on commit afb9f27

Please sign in to comment.