how to throw error/exception from swift singleton init
<p>In my custom swift framework I have a singleton class which end user will be using. The singleton init() does lots of work for which I want to throw error if anything goes wrong during initialisation.</p>

<h2>mySingleton.swift</h2>

<pre><code>public class mySingleton: NSObject {
    .......
    public static let sharedInstance = mySingleton(singleton : true)
    ....
}

private override convenience init() {
    assertionFailure( "Please use sharedInstance" )
    self.init(singleton : false)
}

private init(singleton: true) {
    super.init()

    //Other class objects init() etc.

   //Some other processing etc.

}
</code></pre>

<h2>Framework users:</h2>

<pre><code>//Initialise framework
mySingleton.sharedInstance
</code></pre>

<p>What would be the best way to throw error/exception to the end user during mySingleTon init process.</p>