Add a try/raise block to catch exceptions from calling os module on None

Review Request #860 - Created Aug. 10, 2014 and submitted

Information
Mateo Rodriguez
pants
os-catch-update
Reviewers
pants-reviews
jsirois
If someone defines an Android target without specifying a 'manifest'
field in the BUILD file, they only got a cryptic error. The exception was
never called because the error came earlier, when calling os.path on a None
object. This ensures that the user sees the error message we mean them to.

I have added testing for Android targets to my TODO list.

This patch is small and shouldn't be dependent on any other open reviews.
CI passes.
Did some fuzz testing manually.
Travis passes. [0]

[0] https://travis-ci.org/pantsbuild/pants/builds/32069220

Issues

  • 1
  • 0
  • 0
  • 1
Description From Last Updated
Catch narrow exception types when you can - this is maximally too broad. And echoing Larry's comment - I think ... John Sirois John Sirois
Larry Hosken
John Sirois
Mateo Rodriguez
John Sirois
Mateo Rodriguez
Eric Ayers
John Sirois
John Sirois
Mateo Rodriguez
Review request changed

Status: Closed (submitted)

Loading...