Homec4science

Unsquelch errors when specifying bad environments to ExecFuture

Authored by epriestley <git@epriestley.com> on Jan 1 2015, 16:22.

Description

Unsquelch errors when specifying bad environments to ExecFuture

Summary:
I accidentally passed a nonsense value to setEnv() on an ExecFuture (some non-string-like object).

This ended up trying to convert to a string inside proc_open(), but the @ and PhutilErrorTrap stopped it from ever getting printed or logged, so I had zero clue what was going on (daemon mysteriously exited with an error but no message).

Instead, make sure we string-cast all of env + cwd before we start trapping errors. They'll now throw first, and the exceptions will escape properly.

Test Plan:

  • Mysterious silent crash turned into nice error message showing that I screwed up a variable when building the env.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Differential Revision: https://secure.phabricator.com/D11092

Details

Committed
epriestley <git@epriestley.com>Jan 1 2015, 16:22
Pushed
aubortMar 17 2017, 12:03
Parents
rPHUf9ecfb447892: Default remarkup code blocks to plain text, not PHP
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHU96c7283ab9c7: Unsquelch errors when specifying bad environments to ExecFuture (authored by epriestley <git@epriestley.com>).Jan 1 2015, 16:22