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

Function sendErrorMessage

switch/source/MainScreen.cpp:201–221  ·  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

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

Callers 1

updateMethod · 0.85

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected