diff --git a/pom.xml b/pom.xml
index bfaee1be609c0..3da8b9ef68b90 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3075,6 +3075,10 @@
reduce the cost of migration in subsequent versions.
-->
-Wconf:cat=deprecation&msg=it will become a keyword in Scala 3:e
+
+ -Wconf:cat=deprecation&msg=method getErrorClass in trait SparkThrowable is deprecated:e
-Xss128m
diff --git a/project/SparkBuild.scala b/project/SparkBuild.scala
index 5882fcbf336b0..737efa8f7846b 100644
--- a/project/SparkBuild.scala
+++ b/project/SparkBuild.scala
@@ -254,7 +254,9 @@ object SparkBuild extends PomBuild {
// reduce the cost of migration in subsequent versions.
"-Wconf:cat=deprecation&msg=it will become a keyword in Scala 3:e",
// SPARK-46938 to prevent enum scan on pmml-model, under spark-mllib module.
- "-Wconf:cat=other&site=org.dmg.pmml.*:w"
+ "-Wconf:cat=other&site=org.dmg.pmml.*:w",
+ // SPARK-49937 ban call the method `SparkThrowable#getErrorClass`
+ "-Wconf:cat=deprecation&msg=method getErrorClass in trait SparkThrowable is deprecated:e"
)
}
)