|
@@ -178,8 +178,10 @@ def search(request):
|
|
|
response = augment_solr_response(response, collection, query)
|
|
response = augment_solr_response(response, collection, query)
|
|
|
except RestException, e:
|
|
except RestException, e:
|
|
|
try:
|
|
try:
|
|
|
- response['error'] = json.loads(e.message)['error']['msg']
|
|
|
|
|
- except:
|
|
|
|
|
|
|
+ message = json.loads(e.message)['error']
|
|
|
|
|
+ response['error'] = message.get('msg', message['trace'])
|
|
|
|
|
+ except Exception, e2:
|
|
|
|
|
+ LOG.exception('failed to extract json message: %s' % force_unicode(e2))
|
|
|
LOG.exception('failed to parse json response: %s' % force_unicode(e))
|
|
LOG.exception('failed to parse json response: %s' % force_unicode(e))
|
|
|
response['error'] = force_unicode(e)
|
|
response['error'] = force_unicode(e)
|
|
|
except Exception, e:
|
|
except Exception, e:
|