mirror of
https://github.com/bykof/cordova-plugin-webserver.git
synced 2025-04-05 06:51:53 +08:00
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)])
|
try self.webServer.start(options:[GCDWebServerOption_AutomaticallySuspendInBackground : false, GCDWebServerOption_Port: UInt(port)])
|
||||||
} catch let error {
|
} catch let error {
|
||||||
print(error.localizedDescription)
|
print(error.localizedDescription)
|
||||||
|
self.commandDelegate!.send(CDVPluginResult(status: CDVCommandStatus_ERROR, messageAs: error.localizedDescription), callbackId: command.callbackId)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
let pluginResult = CDVPluginResult(status: CDVCommandStatus_OK)
|
let pluginResult = CDVPluginResult(status: CDVCommandStatus_OK)
|
||||||
self.commandDelegate!.send(pluginResult, callbackId: command.callbackId)
|
self.commandDelegate!.send(pluginResult, callbackId: command.callbackId)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user