improve error message when parsing json that is not a resource
This commit is contained in:
parent
cc496623a6
commit
55c379dab8
|
@ -11100,6 +11100,9 @@ public class JsonParser extends JsonParserBase {
|
|||
|
||||
@Override
|
||||
protected Resource parseResource(JsonObject json) throws IOException, FHIRFormatError {
|
||||
if (!json.has("resourceType")) {
|
||||
throw new FHIRFormatError("Unable to find resource type - maybe not a FHIR resource?");
|
||||
}
|
||||
String t = json.get("resourceType").getAsString();
|
||||
if (Utilities.noString(t))
|
||||
throw new FHIRFormatError("Unable to find resource type - maybe not a FHIR resource?");
|
||||
|
|
|
@ -15542,6 +15542,9 @@ public class JsonParser extends JsonParserBase {
|
|||
|
||||
@Override
|
||||
protected Resource parseResource(JsonObject json) throws IOException, FHIRFormatError {
|
||||
if (!json.has("resourceType")) {
|
||||
throw new FHIRFormatError("Unable to find resource type - maybe not a FHIR resource?");
|
||||
}
|
||||
String t = json.get("resourceType").getAsString();
|
||||
if (Utilities.noString(t))
|
||||
throw new FHIRFormatError("Unable to find resource type - maybe not a FHIR resource?");
|
||||
|
|
|
@ -19539,6 +19539,9 @@ public class JsonParser extends JsonParserBase {
|
|||
|
||||
@Override
|
||||
protected Resource parseResource(JsonObject json) throws IOException, FHIRFormatError {
|
||||
if (!json.has("resourceType")) {
|
||||
throw new FHIRFormatError("Unable to find resource type - maybe not a FHIR resource?");
|
||||
}
|
||||
String t = json.get("resourceType").getAsString();
|
||||
if (Utilities.noString(t))
|
||||
throw new FHIRFormatError("Unable to find resource type - maybe not a FHIR resource?");
|
||||
|
|
|
@ -27405,6 +27405,9 @@ public class JsonParser extends JsonParserBase {
|
|||
|
||||
@Override
|
||||
protected Resource parseResource(JsonObject json) throws IOException, FHIRFormatError {
|
||||
if (!json.has("resourceType")) {
|
||||
throw new FHIRFormatError("Unable to find resource type - maybe not a FHIR resource?");
|
||||
}
|
||||
String t = json.get("resourceType").getAsString();
|
||||
if (Utilities.noString(t))
|
||||
throw new FHIRFormatError("Unable to find resource type - maybe not a FHIR resource?");
|
||||
|
|
|
@ -28161,6 +28161,9 @@ public class JsonParser extends JsonParserBase {
|
|||
|
||||
@Override
|
||||
protected Resource parseResource(JsonObject json) throws IOException, FHIRFormatError {
|
||||
if (!json.has("resourceType")) {
|
||||
throw new FHIRFormatError("Unable to find resource type - maybe not a FHIR resource?");
|
||||
}
|
||||
String t = json.get("resourceType").getAsString();
|
||||
if (Utilities.noString(t))
|
||||
throw new FHIRFormatError("Unable to find resource type - maybe not a FHIR resource?");
|
||||
|
|
Loading…
Reference in New Issue