Skip to content

Commit

Permalink
Pass error string with type
Browse files Browse the repository at this point in the history
  • Loading branch information
ashiagr committed Feb 18, 2022
1 parent 495e0c4 commit a0cea52
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class CardsRestClient @Inject constructor(
UNAUTHORIZED -> TodaysStatsCardErrorType.UNAUTHORIZED
else -> TodaysStatsCardErrorType.GENERIC_ERROR
}
return TodaysStatsCardError(errorType)
return TodaysStatsCardError(errorType, error)
}
}

Expand All @@ -110,7 +110,7 @@ class CardsRestClient @Inject constructor(
UNAUTHORIZED -> PostCardErrorType.UNAUTHORIZED
else -> PostCardErrorType.GENERIC_ERROR
}
return PostCardError(errorType)
return PostCardError(errorType, error)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ class CardsStore @Inject constructor(
}

class TodaysStatsCardError(
val type: TodaysStatsCardErrorType
val type: TodaysStatsCardErrorType,
val message: String? = null
) : OnChangedError

enum class PostCardErrorType {
Expand All @@ -104,7 +105,8 @@ class CardsStore @Inject constructor(
}

class PostCardError(
val type: PostCardErrorType
val type: PostCardErrorType,
val message: String? = null
) : OnChangedError

enum class CardsErrorType {
Expand Down

0 comments on commit a0cea52

Please sign in to comment.