rewardsFailed static method
GameRewardsFailedEvent
rewardsFailed({
- required GameHealthContext health,
- required String op,
- required GameOutcomeFailure failure,
- int? status,
- int durationMs = 0,
- bool timedOut = false,
Builds the rewards-failed health event. op is rewards for the
page/widget fetch, state for the after-close entry check, or the
bridge http path that failed. A timeout stays timeout.
Implementation
static GameRewardsFailedEvent rewardsFailed({
required GameHealthContext health,
required String op,
required GameOutcomeFailure failure,
int? status,
int durationMs = 0,
bool timedOut = false,
}) =>
GameRewardsFailedEvent(
health,
op,
timedOut
? 'timeout'
: switch (failure) {
GameOutcomeFailure.transport => 'network',
GameOutcomeFailure.httpStatus => 'status',
GameOutcomeFailure.invalidResponse => 'invalid_response',
},
status,
durationMs,
);