openFailedReasonFor static method
Maps a non-open PlayDecision to its game_open_failed reason. Null
when the decision opens or renders (no failure to report), and null for
every expected drop: denied, not-shown and busy are recorded on the
delivery outcome, never as health. Only client failures qualify.
Implementation
static String? openFailedReasonFor(PlayDecision decision) =>
switch (decision) {
PlayOpen() => null,
PlayShowEntry() => null,
PlayDrop(:final reason) => switch (reason) {
PlaySession.failBusy => null,
PlaySession.failDenied => null,
PlaySession.failNotShown => null,
PlaySession.failMissingConfig => 'missing_config',
PlaySession.failTimeout => 'timeout',
PlaySession.failNetwork => 'network',
PlaySession.failInvalidResponse => 'invalid_response',
_ => 'error',
},
};