Skip to content

Commit

Permalink
guard against unknow query formats on the Cassandra Session instrumen…
Browse files Browse the repository at this point in the history
…tation, fixes #1058
  • Loading branch information
ivantopo committed Oct 5, 2021
1 parent cd3bb14 commit c5ac1ea
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,9 @@ class InstrumentedSession(underlying: Session) extends AbstractSession {
* @return dml statement type, none if not a dml statement
*/
private def extractStatementType(query: String): Option[String] = {
Option(query.substring(0, query.indexOf(" ")).toLowerCase)
Try(query.substring(0, query.indexOf(" ")).toLowerCase)
.filter(DmlStatementPrefixes.contains)
.toOption
}

private def unsafeExtractExecutor(session: Session): ListeningExecutorService = {
Expand Down

0 comments on commit c5ac1ea

Please sign in to comment.