dankogai / swift-json

Even Swiftier JSON Handler

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JSON (url: ) fails when server is down

ssedov opened this issue · comments

code:
let x = JSON ("http://127.0.0.1:8080/")
when nothing is listening

How to handle that?

Your code was supposed to be:

let x = JSON(url:"http://127.0.0.1:8080/")

You can't omit url: or JSON() takes it as a string containing JSON.

See README.

Dan the Maintainer Thereof