From d43bf3b77c12cf0c3ee941f9427576702c6a5c03 Mon Sep 17 00:00:00 2001
From: boedy <boudewijng@gmail.com>
Date: Mon, 13 May 2019 15:08:15 +0200
Subject: [PATCH] Call error callback if server can't start

---
 src/ios/Webserver.swift | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/ios/Webserver.swift b/src/ios/Webserver.swift
index 907e218..c6c4712 100644
--- a/src/ios/Webserver.swift
+++ b/src/ios/Webserver.swift
@@ -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)