Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exception in shouldHandleRequest #17

Closed
rsdev-darshan opened this issue Nov 23, 2015 · 6 comments
Closed

exception in shouldHandleRequest #17

rsdev-darshan opened this issue Nov 23, 2015 · 6 comments

Comments

@rsdev-darshan
Copy link

getting error ->

fatal error: 'try!' expression unexpectedly raised an error: Error Domain=NSCocoaErrorDomain Code=3840 "No value." UserInfo={NSDebugDescription=No value.}: file /Library/Caches/com.apple.xbs/Sources/swiftlang_PONDEROSA/swiftlang_PONDEROSA-700.1.101.6/src/swift/stdlib/public/core/ErrorType.swift, line 50

in SwiftR.swift file

func shouldHandleRequest(request: NSURLRequest) -> Bool {
if request.URL!.absoluteString.hasPrefix("swiftr://") {
let id = (request.URL!.absoluteString as NSString).substringFromIndex(9)
let msg = webView.stringByEvaluatingJavaScriptFromString("readMessage((id))")!
let data = msg.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)!
let json: AnyObject = try! NSJSONSerialization.JSONObjectWithData(data, options: []) <-- on this line
processMessage(json)
return false
}
return true
}

@adamhartford
Copy link
Owner

What were you doing before this error -- invoking a server method? If so, what does the server method look like and what does it return?

@rsdev-darshan
Copy link
Author

i am getting blank in msg..

@rsdev-darshan
Copy link
Author

it was working fine, but it stopped working suddenly... after i updated the pods

@adamhartford
Copy link
Owner

What does your Podfile look like? Does this happen immediately or only after invoking a server method, or something else? Is it reproducible every time?

@rsdev-darshan
Copy link
Author

immediately on calling connect method...

@rsdev-darshan
Copy link
Author

And actually its fixed now..
I rolled back to swift1.2 and again installed swift2 pod.. and it started working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants