mirror of
https://github.com/Kingsrook/qqq.git
synced 2025-07-18 05:01:07 +00:00
udpated api json parsing (lenient mode); add escaping table names in rdbms
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
**
|
||||
*******************************************************************************/
|
||||
|
Reference in New Issue
Block a user