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

show error message when -on-error=[ask|abort] #6253

Merged
merged 3 commits into from
May 8, 2018
Merged

show error message when -on-error=[ask|abort] #6253

merged 3 commits into from
May 8, 2018

Conversation

mwhooker
Copy link
Contributor

@mwhooker mwhooker commented May 8, 2018

These alternate build behaviors tend to just os.Exit(1). This patch tries to grab any saved errors and log them.

Closes #6252

@mwhooker mwhooker added bug core Core components of Packer labels May 8, 2018
@mwhooker mwhooker requested a review from a team as a code owner May 8, 2018 17:55
@mwhooker mwhooker added this to the upcoming-05-2018-ish milestone May 8, 2018
This way we don't crash if someone sticks something else in the error
key in the state bag (which a quick glance at the code tells me we're
already doing.

Perhaps in the future we can add an error attribute to the state bag
but for now this will have to suffice.
@mwhooker
Copy link
Contributor Author

mwhooker commented May 8, 2018

noticed things like this, so changed it to use Sprintf

state.Put("error", "Can't get the VM switch name")

@mwhooker mwhooker merged commit a10172c into master May 8, 2018
@mwhooker mwhooker deleted the fix6252 branch May 8, 2018 22:31
@ghost
Copy link

ghost commented Apr 1, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug core Core components of Packer
Projects
None yet
Development

Successfully merging this pull request may close these issues.

better error message when remote end disconnects
2 participants