KiCad PCB EDA Suite
Loading...
Searching...
No Matches
kigit_failure.h File Reference
#include <git/kicad_git_common.h>
#include <git/kigit_known_hosts.h>
#include <import_export.h>
#include <optional>
#include <vector>
#include <wx/string.h>

Go to the source code of this file.

Classes

struct  KIGIT_AUTH_ATTEMPT
 What the credential callback handed out during one operation, kept to explain a rejection. More...
 
struct  KIGIT_FAILURE_CONTEXT
 What the failed operation was doing, as far as the message needs it. More...
 
struct  KIGIT_FAILURE_REPORT
 
struct  KIGIT_OWNERSHIP_REFUSAL
 Why git will not open a repository another user owns, and the command that trusts it. More...
 

Namespaces

namespace  KIGIT
 

Enumerations

enum class  KIGIT_FAILURE {
  AUTH_SSH_KEY_REJECTED , AUTH_NO_SSH_KEY , AUTH_HTTPS_REJECTED , KEY_LOAD_FAILED ,
  HOST_KEY_UNKNOWN , HOST_KEY_CHANGED , HOST_KEY_UNVERIFIED , KNOWN_HOSTS_UNREADABLE ,
  SERVER_NOT_FOUND , HOST_UNREACHABLE , TLS_UNTRUSTED , PROXY ,
  REPO_NOT_FOUND , SERVER_REFUSED , PUSH_FORBIDDEN , PUSH_NOT_FAST_FORWARD ,
  CANCELLED , OTHER
}
 Why a transfer failed, in terms of what the user can do about it. More...
 
enum class  KIGIT_OPERATION {
  CONNECT , CLONE , FETCH , PUSH ,
  SET_UP_REMOTE
}
 The transfer that failed, so a message nothing more specific explains can say what did not happen. More...
 

Functions

APIEXPORT KIGIT_FAILURE_REPORT KIGIT::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.
 
APIEXPORT wxString KIGIT::UnexplainedFailure (KIGIT_OPERATION aOperation, const wxString &aUrl)
 The summary for an operation that failed without saying why, naming the server it was talking to.
 
APIEXPORT bool KIGIT::IsCredentialFailure (KIGIT_FAILURE aKind)
 True for the failures another login, key or passphrase can fix, which the credential prompt answers.
 
APIEXPORT wxString KIGIT::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 wxString KIGIT::StripEmbeddedUserinfo (const wxString &aText)
 Remove the user and password from every URL quoted in a message, since the remote's can carry a password.
 
APIEXPORT wxString KIGIT::PrintableServerText (const wxString &aText)
 Text a server sent, made safe to show: no terminal escapes, control or bidi characters, and no URL userinfo.
 
APIEXPORT KIGIT_OWNERSHIP_REFUSAL KIGIT::DescribeOwnershipRefusal (const wxString &aStartDir, const wxString &aGitDir)
 The message for a repository git refuses to open because another user owns it.
 

Variables

constexpr size_t KIGIT::MAX_SERVER_TEXT = 4096
 The longest server text a failure keeps. A refusal's explanation comes last, after any transfer progress.
 

Enumeration Type Documentation

◆ KIGIT_FAILURE

enum class KIGIT_FAILURE
strong

Why a transfer failed, in terms of what the user can do about it.

Enumerator
AUTH_SSH_KEY_REJECTED 
AUTH_NO_SSH_KEY 
AUTH_HTTPS_REJECTED 
KEY_LOAD_FAILED 
HOST_KEY_UNKNOWN 
HOST_KEY_CHANGED 
HOST_KEY_UNVERIFIED 

A key KiCad could not check, so there is nothing to offer to trust.

KNOWN_HOSTS_UNREADABLE 
SERVER_NOT_FOUND 
HOST_UNREACHABLE 
TLS_UNTRUSTED 
PROXY 
REPO_NOT_FOUND 
SERVER_REFUSED 

The server answered with text alone. Its wording is shown but never interpreted.

PUSH_FORBIDDEN 
PUSH_NOT_FAST_FORWARD 
CANCELLED 
OTHER 

Definition at line 43 of file kigit_failure.h.

◆ KIGIT_OPERATION

enum class KIGIT_OPERATION
strong

The transfer that failed, so a message nothing more specific explains can say what did not happen.

Enumerator
CONNECT 
CLONE 
FETCH 
PUSH 
SET_UP_REMOTE 

Definition at line 67 of file kigit_failure.h.