Raise BulkApiError on bad HTTP status code (instead of Exception). Also made the exception class configurable,
so you can pass exception_class=IOError for example on init if you want IOErrors for http errors.
Updated test