renaming exception

dev^2
Razmig Sarkissian 6 years ago
parent 7653ea86ce
commit 7474b33a7e
  1. 2
      app/src/main/java/net/pokeranalytics/android/exceptions/Exceptions.kt
  2. 2
      app/src/main/java/net/pokeranalytics/android/ui/fragment/components/input/InputFragment.kt
  3. 2
      app/src/main/java/net/pokeranalytics/android/ui/helpers/DateTimePickerManager.kt
  4. 2
      app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/BankrollRow.kt
  5. 2
      app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/CustomFieldRow.kt
  6. 2
      app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/LocationRow.kt
  7. 2
      app/src/main/java/net/pokeranalytics/android/ui/view/rowrepresentable/TransactionTypeRow.kt

@ -21,7 +21,7 @@ sealed class PokerAnalyticsException(message: String) : Exception(message) {
object QueryTypeUnhandled: PokerAnalyticsException(message = "queryWith type not handled")
object QueryValueMapUnexpectedValue: PokerAnalyticsException(message = "valueMap null not expected")
object FilterElementExpectedValueMissing : PokerAnalyticsException(message = "queryWith is empty or null")
object BottomSheetException : PokerAnalyticsException(message = "RowEditableDelegate must be a Fragment")
object InputFragmentException : PokerAnalyticsException(message = "RowEditableDelegate must be a Fragment")
object DateTimePickerException: PokerAnalyticsException(message = "DataSource is not a DateRowEditableDescriptor")
data class FilterElementTypeMissing(val filterElementRow: FilterElementRow) : PokerAnalyticsException(message = "queryWith element '$filterElementRow' type is missing")
data class QueryValueMapMissingKeys(val missingKeys: List<String>) : PokerAnalyticsException(message = "valueMap does not contain $missingKeys")

@ -49,7 +49,7 @@ open class InputFragment(val row: RowRepresentable) : BottomSheetDialogFragment(
isDeletable: Boolean? = false,
valueHasPlaceholder: Boolean? = null
) {
if (delegate !is Fragment) throw PokerAnalyticsException.BottomSheetException
if (delegate !is Fragment) throw PokerAnalyticsException.InputFragmentException
if (dataSource?.descriptorType == RowEditableDescriptorType.DATE) {
DateTimePickerManager.buildAndShow(row, delegate, dataSource.descriptors.first())
} else {

@ -35,7 +35,7 @@ class DateTimePickerManager : DatePickerDialog.OnDateSetListener,
dataSource: RowEditableDescriptor
) {
if (delegate !is Fragment) throw PokerAnalyticsException.BottomSheetException
if (delegate !is Fragment) throw PokerAnalyticsException.InputFragmentException
if (dataSource !is DateRowEditableDescriptor) throw PokerAnalyticsException.DateTimePickerException
val calendar = Calendar.getInstance()
calendar.time = dataSource.date ?: Date()

@ -67,7 +67,7 @@ enum class BankrollRow : RowRepresentable {
NAME -> data.append(dataSource.name)
INITIAL_VALUE -> data.append(dataSource.initialValue, R.string.initial_value, InputType.TYPE_CLASS_NUMBER or InputType.TYPE_NUMBER_FLAG_DECIMAL)
RATE -> data.append(dataSource.currency?.rate, R.string.rate, InputType.TYPE_CLASS_NUMBER or InputType.TYPE_NUMBER_FLAG_DECIMAL)
else -> PokerAnalyticsException.BottomSheetException
else -> PokerAnalyticsException.InputFragmentException
}
InputFragment.buildAndShow(this, parent, data)
}

@ -96,7 +96,7 @@ enum class CustomFieldRow : RowRepresentable {
val data = RowEditableDataSource()
when (this) {
NAME -> data.append(dataSource.name)
else -> PokerAnalyticsException.BottomSheetException
else -> PokerAnalyticsException.InputFragmentException
}
InputFragment.buildAndShow(this, parent, data)
}

@ -53,7 +53,7 @@ enum class LocationRow : RowRepresentable {
val data = RowEditableDataSource()
when (this) {
NAME -> data.append(dataSource.name)
else -> PokerAnalyticsException.BottomSheetException
else -> PokerAnalyticsException.InputFragmentException
}
InputFragment.buildAndShow(this, parent, data)
}

@ -48,7 +48,7 @@ enum class TransactionTypeRow : RowRepresentable {
val data = RowEditableDataSource()
when (this) {
NAME -> data.append(dataSource.name)
else -> PokerAnalyticsException.BottomSheetException
else -> PokerAnalyticsException.InputFragmentException
}
InputFragment.buildAndShow(this, parent, data)
}

Loading…
Cancel
Save