From e0fb4b1e343a47294b08eae7cfdabf8ff4d5a942 Mon Sep 17 00:00:00 2001 From: badrinathpatchikolla Date: Mon, 22 May 2023 23:11:13 +0530 Subject: [PATCH 1/2] added the data column in http response case class --- .../music/of/the/ainur/almaren/http/HTTPConnector.scala | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/scala/com/github/music/of/the/ainur/almaren/http/HTTPConnector.scala b/src/main/scala/com/github/music/of/the/ainur/almaren/http/HTTPConnector.scala index ee058b6..2b06204 100644 --- a/src/main/scala/com/github/music/of/the/ainur/almaren/http/HTTPConnector.scala +++ b/src/main/scala/com/github/music/of/the/ainur/almaren/http/HTTPConnector.scala @@ -20,7 +20,8 @@ final case class Response( `__STATUS_MSG__`:Option[String] = None, `__ERROR__`:Option[String] = None, `__ELAPSED_TIME__`:Long, - `__URL__`:String) + `__URL__`:String, + `__DATA__`: String) final case class ResponseBatch( `__ID__`:Seq[String], @@ -77,7 +78,7 @@ private[almaren] case class HTTP( val response = Try(requestHandler(row,session,url,headers,params ++ hiddenParams,method,connectTimeout,readTimeout)) val elapsedTime = System.currentTimeMillis() - startTime val id = row.getAs[Any](Alias.IdCol).toString - + val data = row.getAs[Any](Alias.DataCol).toString def getResponse(r: requests.Response) = Response( id, Some(r.text()), @@ -88,7 +89,8 @@ private[almaren] case class HTTP( case _ => Some(r.statusMessage) }, `__ELAPSED_TIME__` = elapsedTime, - `__URL__` = url + `__URL__` = url, + `__DATA__` = data ) response match { From f7c1167ca1629a6e55000951c5adfbfb4ab62954 Mon Sep 17 00:00:00 2001 From: badrinathpatchikolla Date: Mon, 22 May 2023 23:17:43 +0530 Subject: [PATCH 2/2] Fixed the Response Case class --- .../github/music/of/the/ainur/almaren/http/HTTPConnector.scala | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/scala/com/github/music/of/the/ainur/almaren/http/HTTPConnector.scala b/src/main/scala/com/github/music/of/the/ainur/almaren/http/HTTPConnector.scala index 2b06204..7b8fbc8 100644 --- a/src/main/scala/com/github/music/of/the/ainur/almaren/http/HTTPConnector.scala +++ b/src/main/scala/com/github/music/of/the/ainur/almaren/http/HTTPConnector.scala @@ -98,7 +98,7 @@ private[almaren] case class HTTP( case Failure(re: RequestFailedException) => getResponse(re.response) case Failure(f) => { logger.error("Almaren HTTP Request Error", f) - Response(id, `__ERROR__` = Some(f.getMessage), `__ELAPSED_TIME__` = elapsedTime, `__URL__` = url) + Response(id, `__ERROR__` = Some(f.getMessage), `__ELAPSED_TIME__` = elapsedTime, `__URL__` = url, `__DATA__` = data) } } }