function getError(json) {
let errorStr = "";
let messageStr = "";
if (json.g && json.g[0]) {
[errorStr] = json.g;
} else if (json.upload && json.upload.length > 0) {
[errorStr] = json.upload;
} else if (json.features) {
[errorStr] = json.features;
} else if (json.detail) {
errorStr = json.detail;
}
if (errorStr.indexOf("Max area of 5.7 exceeded") > -1) {
messageStr = `Area of uploaded feature is too large. Maximum
area supported is 20,000 sq. miles.`;
} else if (errorStr.indexOf("Upload a valid data source") > -1) {
messageStr = `File is corrupted or not a valid data source`;
} else {
messageStr = errorStr;
}
return messageStr;
}