Skip to content

Commit

Permalink
Fixed r.statusCode to Handle NUll
Browse files Browse the repository at this point in the history
  • Loading branch information
badrinathpatchikolla committed Nov 29, 2022
1 parent 76501c3 commit 0899e60
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ private[almaren] case class HTTP(
Some(r.text()),
r.headers,
Some(r.statusCode),
Some(r.statusMessage),
r.statusMessage match {
case null => None
case _ => Some(r.statusMessage)
},
`__ELAPSED_TIME__` = elapsedTime,
`__URL__` = url)
case Failure(f) => {
Expand Down Expand Up @@ -124,7 +127,10 @@ private[almaren] case class HTTPBatch(
Some(r.text()),
r.headers,
Some(r.statusCode),
Some(r.statusMessage),
r.statusMessage match {
case null => None
case _ => Some(r.statusMessage)
},
`__ELAPSED_TIME__` = System.currentTimeMillis() - startTime,
`__URL__` = url,
`__DATA__` = data
Expand Down

0 comments on commit 0899e60

Please sign in to comment.