Initially, self._error['error_data'] contains blame_field_specs field as str.
We are jsonifying self._error['error_data'] but getting blame_field_specs from initial object.
So the fixed row getting exception:
Traceback (most recent call last):
...
File "~/work/fanerd/venv_new_38/lib/python3.8/site-packages/facebook_business/api.py", line 125, in error
return FacebookRequestError(
File "~/work/fanerd/venv/lib/python3.8/site-packages/facebook_business/exceptions.py", line 85, in __init__
self._error['error_data']['blame_field_specs']
TypeError: string indices must be integers
Here is body response:
{
'message': 'Invalid parameter',
'type': 'OAuthException',
'code': 100,
'error_data': '{"blame_field_specs":[["time_stop"]]}',
'error_subcode': 1487094,
'is_transient': False,
'error_user_title':
'No end date entered',
'error_user_msg': 'Ad sets using lifetime as the budget type must have an end date. Enter an end date more than 24 hours after the start time.',
'fbtrace_id': 'AJu7yY4Mxbu0hpRv3hgvdwF'
}
Initially,
self._error['error_data']
containsblame_field_specs
field as str. We are jsonifyingself._error['error_data']
but gettingblame_field_specs
from initial object. So the fixed row getting exception:Here is body response: