fix(quickschedule): properly handle errors from QuickSchedule server

This commit is contained in:
Drew Regitsky 2015-12-30 16:46:19 -08:00
parent f640ef4ee0
commit d3572f3206

View file

@ -21,6 +21,8 @@ class AvailabilityComposerExtension extends ComposerExtension
serverUrl = "https://quickschedule.herokuapp.com/register-events"
post({url: serverUrl, body: JSON.stringify(data)})
.then (args) =>
if args[0].statusCode != 200
throw new Error()
data = args[1]
return data
.catch (error) ->