udpated api json parsing (lenient mode); add escaping table names in rdbms

This commit is contained in:
2022-10-25 10:47:06 -05:00
parent dae803f709
commit 8ffc1c1a63
8 changed files with 120 additions and 45 deletions

View File

@ -263,7 +263,7 @@ public class BaseAPIActionUtil
*******************************************************************************/
protected QRecord jsonObjectToRecord(JSONObject jsonObject, Map<String, QFieldMetaData> fields) throws IOException
{
QRecord record = JsonUtils.parseQRecord(jsonObject, fields);
QRecord record = JsonUtils.parseQRecordLenient(jsonObject, fields);
return (record);
}
@ -277,6 +277,11 @@ public class BaseAPIActionUtil
int statusCode = response.getStatusLine().getStatusCode();
System.out.println(statusCode);
if(statusCode >= 400)
{
handleGetResponseError(table, response);
}
HttpEntity entity = response.getEntity();
String resultString = EntityUtils.toString(entity);
@ -318,6 +323,18 @@ public class BaseAPIActionUtil
/*******************************************************************************
**
*******************************************************************************/
private void handleGetResponseError(QTableMetaData table, HttpResponse response) throws IOException
{
HttpEntity entity = response.getEntity();
String resultString = EntityUtils.toString(entity);
throw new IOException("Error performing query: " + resultString);
}
/*******************************************************************************
**
*******************************************************************************/