Make `type` optional on errors

This will allow us to maintain backward compatibility with the API for a bit
longer, so as not to necessitate a major version bump.