fix(quickschedule): properly handle errors from QuickSchedule server

This commit is contained in:
Drew Regitsky 2015-12-30 16:46:19 -08:00
parent 067a12dc17
commit 77cf91f292

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) ->