abhishekd0907 commented on a change in pull request #99:
URL: https://github.com/apache/bahir/pull/99#discussion_r460488174
##########
File path:
sql-streaming-sqs/src/main/scala/org/apache/spark/sql/streaming/sqs/SqsClient.scala
##########
@@ -220,11 +220,12 @@ class SqsClient(sourceOptions: SqsSourceOptions,
.standard()
.withClientConfiguration(new
ClientConfiguration().withMaxConnections(maxConnections))
.withCredentials(instanceProfileCredentialsProvider)
+ .withRegion(region)
.build()
}
} catch {
case e: Exception =>
- throw new SparkException(s"Error occured while creating Amazon SQS
Client ${e.getMessage}")
+ throw new SparkException(s"Error occured while creating Amazon SQS
Client", e)
Review comment:
`getMessage` returns null for some AWS exceptions. Better way to show
stacktrace is to pass the cause to SparkException.
Example:
```
throw new SparkException("outer exception", new
ArrayIndexOutOfBoundsException("inner message")) =>
org.apache.spark.SparkException: outer exception
... 49 elided
Caused by: java.lang.ArrayIndexOutOfBoundsException: inner message
... 49 more
```
How old code worked:
```
val e = new ArrayIndexOutOfBoundsException()
throw new SparkException(s"outer exception ${e.getMessage}") =>
org.apache.spark.SparkException:outer exception null
... 49 elided
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]