Skip to content

Commit

Permalink
#293 hide stacktrace if connection to web hook fails
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Aug 28, 2017
1 parent bb6e4d0 commit 830fef3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions thehive-backend/app/services/WebHook.scala
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package services

import java.net.ConnectException
import javax.inject.Inject

import scala.concurrent.ExecutionContext
Expand All @@ -14,6 +15,7 @@ case class WebHook(name: String, ws: WSRequest)(implicit ec: ExecutionContext) {

def send(obj: JsObject) = ws.post(obj).onComplete {
case Success(resp) if resp.status / 100 != 2 logger.error(s"WebHook returns status ${resp.status} ${resp.statusText}")
case Failure(ce: ConnectException) logger.error(s"Connection to WebHook $name error", ce)
case Failure(error) logger.error("WebHook call error", error)
case _
}
Expand Down

0 comments on commit 830fef3

Please sign in to comment.