Skip to content

Commit

Permalink
QR scan failure now correctly displays specific error message and not…
Browse files Browse the repository at this point in the history
… generic message
  • Loading branch information
AdityaK2905 committed Nov 20, 2024
1 parent 27e9e85 commit f7998d7
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class ScannerViewModel : ViewModel() {
try {
if (e is HttpException) {
val jsonObject = JSONObject("" + e.response()?.errorBody()?.string())
error = jsonObject.optString("error", e.message.toString())
error = jsonObject.optString("message", e.message.toString())
}
} catch (e: Exception) { }
Log.e("STAFF MEETING ERROR", error)
Expand All @@ -64,7 +64,7 @@ class ScannerViewModel : ViewModel() {
try {
if (e is HttpException) {
val jsonObject = JSONObject("" + e.response()?.errorBody()?.string())
error = jsonObject.optString("error", e.message.toString())
error = jsonObject.optString("message", e.message.toString())
}
} catch (e: Exception) { }
Log.e("CHECK IN ATTENDEE ERROR", error)
Expand All @@ -86,7 +86,7 @@ class ScannerViewModel : ViewModel() {
try {
if (e is HttpException) {
val jsonObject = JSONObject("" + e.response()?.errorBody()?.string())
error = jsonObject.optString("error", e.message.toString())
error = jsonObject.optString("message", e.message.toString())
}
} catch (e: Exception) { }
Log.e("CHECK IN EVENT ERROR", error)
Expand All @@ -108,7 +108,7 @@ class ScannerViewModel : ViewModel() {
try {
if (e is HttpException) {
val jsonObject = JSONObject("" + e.response()?.errorBody()?.string())
error = jsonObject.optString("error", e.message.toString())
error = jsonObject.optString("message", e.message.toString())
}
} catch (e: Exception) { }
Log.e("CHECK IN MENTOR ERROR", error)
Expand All @@ -131,7 +131,7 @@ class ScannerViewModel : ViewModel() {
try {
if (e is HttpException) {
val jsonObject = JSONObject("" + e.response()?.errorBody()?.string())
error = jsonObject.optString("error", e.message.toString())
error = jsonObject.optString("message", e.message.toString())
}
} catch (e: Exception) { }
Log.e("PURCHASE ITEM ERROR", error)
Expand Down

0 comments on commit f7998d7

Please sign in to comment.