Avoid the var unless really needed:
```scala
val extraInfo = (if(RichXHandler().handlers.exists(h => h(t))) {
  RichXHandler.mapping(t.getClass) + "\n"
}
else {
  ""
}) +
  "If you know what exactly caused this error, please consider contributing to GitHub via following link.\n" + gitHubLink
```