lovinghouston / lwcgoogleplacesbutton

Adds a Lightning Web Component to create Google Place Listings (currently hardcoded to type "church") as a Salesforce object (currently hardcoded to a custom object named Church_School_Partnership__c).
3 stars 1 forks source link

Throw new Exception if initial Status Code is bad #67

Closed sungysang closed 4 years ago

sungysang commented 4 years ago

Google does not populate the default status code on the HTTPResponse so response.getStatusCode() will always be 200 even if an error message is inside it. For situations where Salesforce has issues getting back a response or sending a request, instead of returning null if the status != 200, an exception should be thrown to the backend and frontend that describes the issue.

sungysang commented 4 years ago

@Julian88Tex this can be closed unless you want testing on it, although it may be tough to test since I'm not sure how to reproduce an API error in Salesforce

Julian88Tex commented 4 years ago

@sungysang I consider testing of #57 as a valid test of this issue and will close. Thanks.