diff --git a/pdblp/pdblp.py b/pdblp/pdblp.py index 68f421b..6d3166c 100644 --- a/pdblp/pdblp.py +++ b/pdblp/pdblp.py @@ -304,6 +304,10 @@ def _bdh_list(self, tickers, flds, start_date, end_date, elms, # Process received events for msg in self._receive_events(): d = msg['element']['HistoricalDataResponse'] + + if 'responseError' in d: + raise ValueError(d) + has_security_error = 'securityError' in d['securityData'] has_field_exception = len(d['securityData']['fieldExceptions']) > 0 if has_security_error or has_field_exception: @@ -375,6 +379,10 @@ def _parse_ref(self, flds, keep_corrId=False, sent_events=1): else: corrId = [] d = msg['element']['ReferenceDataResponse'] + + if 'responseError' in d: + raise ValueError(d) + for security_data_dict in d: secData = security_data_dict['securityData'] ticker = secData['security'] @@ -477,6 +485,10 @@ def _parse_bulkref(self, flds, keep_corrId=False, sent_events=1): else: corrId = [] d = msg['element']['ReferenceDataResponse'] + + if 'responseError' in d: + raise ValueError(d) + for security_data_dict in d: secData = security_data_dict['securityData'] ticker = secData['security']