MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / sendErrorMessage

Function sendErrorMessage

switch/source/MainScreen.cpp:203–223  ·  view source on GitHub ↗

Maps a failed network send to a user-facing message (mirrors the 3DS OutcomeMessages::sendError). EmptyBackup and Cancelled are handled by the caller as neutral info, so they only appear here as a fallback.

Source from the content-addressed store, hash-verified

201 // OutcomeMessages::sendError). EmptyBackup and Cancelled are handled by the
202 // caller as neutral info, so they only appear here as a fallback.
203 std::string sendErrorMessage(const Transfer::SendOutcome& outcome)
204 {
205 switch (outcome.stage) {
206 case Transfer::SendStage::PayloadTooLarge:
207 return i18n::t("outcome.send_too_large");
208 case Transfer::SendStage::Zip:
209 return i18n::t("outcome.send_zip");
210 case Transfer::SendStage::Socket:
211 return i18n::t("outcome.send_socket");
212 case Transfer::SendStage::Resolve:
213 return i18n::t("outcome.send_resolve");
214 case Transfer::SendStage::Connect:
215 return i18n::t("outcome.send_connect");
216 case Transfer::SendStage::Response:
217 return outcome.detail.empty() ? i18n::t("outcome.send_no_response") : i18n::t("outcome.send_receiver_error", {outcome.detail});
218 case Transfer::SendStage::Send:
219 return i18n::t("outcome.send_interrupted");
220 default:
221 return i18n::t("outcome.send_failed");
222 }
223 }
224}
225
226MainScreen::MainScreen(const InputState&)

Callers 1

updateMethod · 0.85

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected