TitleCrawlerHandler : Print out errors to stderr.
This commit is contained in:
parent
194c8b2eed
commit
94ff02efe8
|
@ -14,9 +14,12 @@ import scala.language.postfixOps
|
|||
*/
|
||||
class TitleCrawlerHandler extends HttpHandler, Handler {
|
||||
override def handle(exchange: HttpExchange): Unit = {
|
||||
val body = exchange.getRequestBody.readAllBytes()
|
||||
log(body)
|
||||
exchange.sendResponse(body)
|
||||
try {
|
||||
val body = exchange.getRequestBody.readAllBytes()
|
||||
log(body)
|
||||
exchange.sendResponse(body)
|
||||
} catch
|
||||
case e: Exception => System.err.println(e)
|
||||
}
|
||||
|
||||
private def log(body: Array[Byte]): Unit = {
|
||||
|
|
Reference in a new issue