35 while( ( lineEnd =
m_pendingSideband.find_first_of(
"\r\n", lineStart ) ) != std::string::npos )
38 lineStart = lineEnd + 1;
51 if( !progress.IsEmpty() )
75 m_serverMessage.erase( 0, lineEnd == wxString::npos ? wxString::npos : lineEnd + 1 );
109 wxLogTrace(
traceGit,
"Transfer failed with code %d, class %d, kind %d: %s", aError.
code, aError.
klass,
void AddError(const wxString &aSummary, const wxString &aDetails)
A summary the user can act on, with the raw text that explains it kept apart for the details.
void SetPushRefusal(const wxString &aStatus)
std::optional< KIGIT_FAILURE > m_failureKind
std::optional< KIGIT::HOST_KEY_FAILURE > m_hostKeyFailure
KIGIT_FAILURE_REPORT ReportTransferFailure(const KIGIT_ERROR_INFO &aError, KIGIT_OPERATION aOperation, const wxString &aRemoteName)
Classify a failed libgit2 transfer call and queue its summary and details.
bool m_skippingServerLine
KIGIT_AUTH_ATTEMPT m_authAttempt
wxString m_hostKeyRefusal
std::string m_pendingSideband
void addServerLine(const wxString &aLine)
void ReceiveSideband(const char *aData, size_t aLength)
Keep sideband text the server sent for the user, such as why it refused a pushed branch,...
void UpdateProgress(int aCurrent, int aTotal, const wxString &aMessage) override
const wxChar *const traceGit
Flag to enable Git debugging output.
KIGIT_OPERATION
The transfer that failed, so a message nothing more specific explains can say what did not happen.
APIEXPORT wxString PrintableServerText(const wxString &aText)
Text a server sent, made safe to show: no terminal escapes, control or bidi characters,...
constexpr size_t MAX_SERVER_TEXT
The longest server text a failure keeps. A refusal's explanation comes last, after any transfer progr...
APIEXPORT wxString DecodeServerText(const char *aData, size_t aLength)
Bytes a server sent, as UTF-8 or, when they are not valid UTF-8, one character for each byte.
APIEXPORT bool IsCredentialFailure(KIGIT_FAILURE aKind)
True for the failures another login, key or passphrase can fix, which the credential prompt answers.
APIEXPORT KIGIT_FAILURE_REPORT DescribeGitFailure(const KIGIT_ERROR_INFO &aError, const KIGIT_AUTH_ATTEMPT &aAuth, const KIGIT_FAILURE_CONTEXT &aContext)
Turn a failed transfer into a message the user can act on.
What libgit2 reported for a failed call, read before anything else can replace it.
int code
The failed call's return value.
What the failed operation was doing, as far as the message needs it.
KIGIT_OPERATION operation
std::optional< KIGIT::HOST_KEY_FAILURE > hostKey
The host key the operation refused, if any.
wxString hostKeyRefusal
Why a key that cannot be trusted was refused.
bool authFailed
The credential callback had nothing left to offer.
wxString url
The address connected to. Messages show only its host and its stripped form.
wxString remoteName
Empty when the operation has no named remote, as for a clone.
wxString pushRefusal
The status the server gave a refused branch.
wxString serverMessage
Text the server sent for the user.
wxString summary
What happened and what to do next, in the user's terms. Never raw text.
wxString details
The raw error, the server's text and the address without its password.
wxLogTrace helper definitions.