production errors

This commit is contained in:
smileomi18@gmail.com
2023-09-12 13:04:57 +05:30
parent 57a0c2103a
commit 388af0adf6

View File

@@ -251,7 +251,7 @@ class MainActivity : AppCompatActivity() {
try {
fusedLocationClient.lastLocation.addOnSuccessListener { location: Location? ->
location?.let {
DataHolder.selectedTest!!.location =
@@ -270,15 +270,7 @@ class MainActivity : AppCompatActivity() {
val rootView = findViewById<View>(android.R.id.content)
Snackbar.make(rootView, errorMessage, Snackbar.LENGTH_LONG).show()
}
} catch (e: Exception) {
// Handle the exception here
e.printStackTrace()
FirebaseCrashlytics.getInstance().recordException(e)
// Display an error message to the user using a Snackbar
val errorMessage = "An error occurred: ${e.message}"
val rootView = findViewById<View>(android.R.id.content)
Snackbar.make(rootView, errorMessage, Snackbar.LENGTH_LONG).show()
}