How can try / catch namely in the catch block

catch (e: Exception) { e.log() 

can e lead to a String type and compare it with some string?

  • What for? For it can be differently depending on the goals. - Yuriy SPb
  • @YurySPb I need to compare e with a specific error and if the error text matches, then send a knock using EventBus'a - Inkognito
  • If you write the error message yourself / know exactly what it is, then you can use e.getMessage() - Yuriy SPb
  • @ YuriyPb fit, thank you. - Inkognito

1 answer 1

Most likely, the receipt of a message contained in an error like this should help:

 String message = e.getMessage();