add --platform, fixes #63
make sure errors are wrapped in objects