Skip to main content

CommandError

Enum CommandError 

Source
pub enum CommandError {
    Empty,
    TooLong {
        len: usize,
        max: usize,
    },
    ControlByte {
        byte: u8,
        at: usize,
    },
    NotUtf8,
    UnknownCommand(String),
    NotServed {
        verb: &'static str,
        why: &'static str,
    },
    MissingPath(&'static str),
    MissingOperation {
        verb: &'static str,
        accepted: String,
    },
    UnknownOperation {
        verb: &'static str,
        operation: String,
        accepted: String,
    },
    BadQuoting(&'static str),
    Path {
        reason: Option<PathReject>,
        message: String,
    },
}
Expand description

Why an exec request was refused.

Every variant means the same thing on the wire (channel_failure, no shell), but they are distinguished so the server log says which one happened.

Variants§

§

Empty

Nothing was sent.

§

TooLong

Fields

§len: usize

What arrived.

§max: usize

What is allowed.

§

ControlByte

A NUL or other control byte was present.

Fields

§byte: u8

The offending byte.

§at: usize

Where it was.

§

NotUtf8

Not UTF-8.

§

UnknownCommand(String)

The verb is not one of SERVICES. This is the bash case.

§

NotServed

A git verb gunnar knows the name of and does not serve, refused by name so the client prints a sentence rather than exec request failed on channel 0. Today that is git-upload-archive (git archive --remote=): it is not a transfer, the archive is a local operation on a clone, and answering it would be a second read path beside upload-pack. The site test measured the bare channel failure on 2026-08-30 and asked for the sentence.

Fields

§verb: &'static str

Which verb.

§why: &'static str

The sentence the client is owed.

§

MissingPath(&'static str)

A known verb with no argument.

§

MissingOperation

A verb that takes an <operation> was sent without one.

Fields

§verb: &'static str

Which verb.

§accepted: String

What it would have accepted, comma-separated.

§

UnknownOperation

A verb that takes an <operation> was sent one it does not accept.

The offending token is carried escaped, because it came off the wire and goes into a log line.

Fields

§verb: &'static str

Which verb.

§operation: String

What arrived, with control bytes already refused upstream.

§accepted: String

What it would have accepted, comma-separated.

§

BadQuoting(&'static str)

The quoting was malformed: unterminated, or trailing bytes after the closing quote.

§

Path

The path did not survive the sandbox in gunnar_core::resolve_repo_path.

The rendered refusal is carried rather than the gunnar_core::Error itself, which is neither Clone nor PartialEq, and reason is kept alongside it so a test can assert which rule fired rather than merely that something failed. A path refused for the wrong reason is one refactor away from being accepted.

Fields

§reason: Option<PathReject>

Which sandbox rule fired, when the sandbox named one.

§message: String

The rendered refusal, with the offending input already escaped for safe logging by gunnar-core.

Trait Implementations§

Source§

impl Clone for CommandError

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CommandError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for CommandError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for CommandError

Source§

impl Error for CommandError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<CommandError> for DispatchError

Source§

fn from(source: CommandError) -> Self

Converts to this type from the input type.
Source§

impl From<Error> for CommandError

Source§

fn from(err: Error) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for CommandError

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for CommandError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> ErrorExt for T
where T: Error + Send + Sync + 'static,

Source§

fn raise(self) -> Exn<Self>
where Self: Sized,

Raise this error as a new exception.
Source§

fn and_raise<T>(self, context: T) -> Exn<T>
where T: Error + Send + Sync + 'static, Self: Sized,

Raise this error as a child of a new exception with the given context error. Read more
Source§

fn raise_erased(self) -> Exn
where Self: Sized,

Raise this error as a new exception, with type erasure.
Source§

fn raise_all<T, I>(self, sources: I) -> Exn<Self>
where Self: Sized, T: Error + Send + Sync + 'static, I: IntoIterator, <I as IntoIterator>::Item: Into<Exn<T>>,

Raise this error as a new exception, with sources as causes.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more