Call error callback if server can't start
This commit is contained in:
parent
64b5089b6b
commit
d43bf3b77c
@ -124,6 +124,8 @@
|
||||
try self.webServer.start(options:[GCDWebServerOption_AutomaticallySuspendInBackground : false, GCDWebServerOption_Port: UInt(port)])
|
||||
} catch let error {
|
||||
print(error.localizedDescription)
|
||||
self.commandDelegate!.send(CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription), callbackId: command.callbackId)
|
||||
return
|
||||
}
|
||||
let pluginResult = CDVPluginResult(status: CDVCommandStatus_OK)
|
||||
self.commandDelegate!.send(pluginResult, callbackId: command.callbackId)
|
||||
|
Loading…
x
Reference in New Issue
Block a user