Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure proper paths are shown in config loading exceptions #11056

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/vagrant/config/loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def load(order)
path = "(unknown)"
if e.backtrace && e.backtrace[0]
backtrace_tokens = e.backtrace[0].split(":")
path = backtrace_tokens[0]
path = e.backtrace.first.slice(0, e.backtrace.first.rindex(':')).rpartition(':').first
backtrace_tokens.each do |part|
if part =~ /\d+/
line = part.to_i
Expand Down
2 changes: 1 addition & 1 deletion plugins/kernel_v2/config/vm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ def finalize!

line = "(unknown)"
if e.backtrace && e.backtrace[0]
line = e.backtrace[0].split(":")[1]
line = e.backtrace.first.slice(0, e.backtrace.first.rindex(':')).rpartition(':').last
end

raise Vagrant::Errors::VagrantfileLoadError,
Expand Down