title: Propagating base class errors in Swift
body: <p>I wanted <code>NSTextField</code> which will replace empty string with 0 (or minimum allowed value), so I have created custom <code>NSNumberFormatter</code>:</p>
  
  <pre><code>class NonEmptyNumberFormatter: NSNumberFormatter {    
      override func getObjectValue(obj: AutoreleasingUnsafeMutablePointer&lt;AnyObject?&gt;, forString string: String, range rangep: UnsafeMutablePointer&lt;NSRange&gt;) throws {
          if string.isEmpty {
              obj.memory = self.minimum ?? 0
          } else {
              try super.getObjectValue(obj, forString: string, range: rangep)
          }
      }
  }
  </code></pre>
  
  <p>It works fine for empty strings, however if I set <code>minimum</code> property, then entering a value smaller than <code>minimum</code> crashes the application. </p>
  
  <p>Is something wrong with <code>try super.getObjectValue(...)</code> call? </p>
  
  <p>I want to preserve the base class (<code>NSNumberFormatter</code>) behavior for non-empty strings.</p>
  
  <p>Here's a sample gist to test it in the playground: <a href="https://gist.github.com/iskeld/a6ba57b145f2f9208fa63efc69d2c517" rel="nofollow">https://gist.github.com/iskeld/a6ba57b145f2f9208fa63efc69d2c517</a>
  - I don't understand why <code>OverridenFormatter</code> causes error when it's only delegating the call to the base class.</p>