catch panics and return them as errors

Signed-off-by: Zach Robinson <zrobinson@pivotallabs.com>