Scala

Scala

Made by DeepSource

Consider specifying type in catch clause SC-W1089

Bug risk
Critical

Cases within the catch clause potentially allow you to recover from an error within your application. Because you have Error-s apart from Exception-s under Throwable-s, you may end up trying to recover from a point of no return such as running under extremely low memory limits. Therefore, it is always a good practice to specify types.

Bad Practice

try {
  // ...
} catch {
  case e =>
}

Recommended

try {
  // ...
} catch {
  case e: IllegalArgumentException =>
}