Display an error when an API fails to parse.

This commit is contained in:
David M. Lee 2013-04-03 13:54:11 -05:00
parent 7929dbfee1
commit 0b4fa11486

View File

@ -43,11 +43,15 @@ object ApiExtractor extends RemoteUrl {
Some(parse(json).extract[ApiListing])
}
catch {
case e:java.io.FileNotFoundException => {
case e: java.io.FileNotFoundException => {
println("WARNING! Unable to read API " + basePath + api.path)
None
}
case _ : Throwable=> None
case e: Throwable => {
println("WARNING! Unable to read API " + basePath + api.path)
e.printStackTrace()
None
}
}
}).flatten.toList
}
@ -68,4 +72,4 @@ object ApiExtractor extends RemoteUrl {
def extractApiOperations(basePath: String, apiDescription: ApiDescription): List[(String, Operation)] = {
(for(op <- apiDescription.operations) yield (apiDescription.path, op)).toList
}
}
}