NSCocoaErrorDomain Code=3840
<p>I have Problems with coding in Swift.</p>

<p>I want to parse a JSON String but I get this Error:</p>

<pre><code>Error Domain=NSCocoaErrorDomain Code=3840 "No value for key in object around character 8." UserInfo={NSDebugDescription=No value for key in object around character 8.}
</code></pre>

<p>I don't know, how to handle this error. All error messages in Swift are unintelligible for me. Errors in other language are much easier.</p>

<p>My Code:</p>

<pre><code>let jsonString = "{\"name:\"fred\", \"age\":40}"
    let jsonData = jsonString.dataUsingEncoding(NSUTF8StringEncoding)!
    do {
        let parsed = try NSJSONSerialization.JSONObjectWithData(jsonData, options: NSJSONReadingOptions.AllowFragments)
        print(parsed)
    } catch let error as NSError {
        print("\(error)")
    }
</code></pre>