common_error::status_code

Enum StatusCode

source
pub enum StatusCode {
Show 37 variants Success = 0, Unknown = 1_000, Unsupported = 1_001, Unexpected = 1_002, Internal = 1_003, InvalidArguments = 1_004, Cancelled = 1_005, IllegalState = 1_006, External = 1_007, InvalidSyntax = 2_000, PlanQuery = 3_000, EngineExecuteQuery = 3_001, TableAlreadyExists = 4_000, TableNotFound = 4_001, TableColumnNotFound = 4_002, TableColumnExists = 4_003, DatabaseNotFound = 4_004, RegionNotFound = 4_005, RegionAlreadyExists = 4_006, RegionReadonly = 4_007, RegionNotReady = 4_008, RegionBusy = 4_009, TableUnavailable = 4_010, DatabaseAlreadyExists = 4_011, StorageUnavailable = 5_000, RequestOutdated = 5_001, RuntimeResourcesExhausted = 6_000, RateLimited = 6_001, UserNotFound = 7_000, UnsupportedPasswordType = 7_001, UserPasswordMismatch = 7_002, AuthHeaderNotFound = 7_003, InvalidAuthHeader = 7_004, AccessDenied = 7_005, PermissionDenied = 7_006, FlowAlreadyExists = 8_000, FlowNotFound = 8_001,
}
Expand description

Common status code for public API.

Variants§

§

Success = 0

Success.

§

Unknown = 1_000

Unknown error.

§

Unsupported = 1_001

Unsupported operation.

§

Unexpected = 1_002

Unexpected error, maybe there is a BUG.

§

Internal = 1_003

Internal server error.

§

InvalidArguments = 1_004

Invalid arguments.

§

Cancelled = 1_005

The task is cancelled.

§

IllegalState = 1_006

Illegal state, can be exposed to users.

§

External = 1_007

Caused by some error originated from external system.

§

InvalidSyntax = 2_000

SQL Syntax error.

§

PlanQuery = 3_000

Fail to create a plan for the query.

§

EngineExecuteQuery = 3_001

The query engine fail to execute query.

§

TableAlreadyExists = 4_000

Table already exists.

§

TableNotFound = 4_001

Table not found.

§

TableColumnNotFound = 4_002

Table column not found.

§

TableColumnExists = 4_003

Table column already exists.

§

DatabaseNotFound = 4_004

Database not found.

§

RegionNotFound = 4_005

Region not found.

§

RegionAlreadyExists = 4_006

Region already exists.

§

RegionReadonly = 4_007

Region is read-only in current state.

§

RegionNotReady = 4_008

Region is not in a proper state to handle specific request.

§

RegionBusy = 4_009

Region is temporarily in busy state.

§

TableUnavailable = 4_010

Table is temporarily unable to handle the request.

§

DatabaseAlreadyExists = 4_011

Database already exists.

§

StorageUnavailable = 5_000

Storage is temporarily unable to handle the request.

§

RequestOutdated = 5_001

Request is outdated, e.g., version mismatch.

§

RuntimeResourcesExhausted = 6_000

Runtime resources exhausted, like creating threads failed.

§

RateLimited = 6_001

Rate limit exceeded.

§

UserNotFound = 7_000

User not exist.

§

UnsupportedPasswordType = 7_001

Unsupported password type.

§

UserPasswordMismatch = 7_002

Username and password does not match.

§

AuthHeaderNotFound = 7_003

Not found http authorization header.

§

InvalidAuthHeader = 7_004

Invalid http authorization header.

§

AccessDenied = 7_005

Illegal request to connect catalog-schema.

§

PermissionDenied = 7_006

User is not authorized to perform the operation.

§

FlowAlreadyExists = 8_000

§

FlowNotFound = 8_001

Implementations§

source§

impl StatusCode

source

pub const fn from_repr(discriminant: usize) -> Option<StatusCode>

Try to create Self from the raw representation

source§

impl StatusCode

source

pub fn is_success(code: u32) -> bool

Returns true if code is success.

source

pub fn is_retryable(&self) -> bool

Returns true if the error with this code is retryable.

source

pub fn should_log_error(&self) -> bool

Returns true if we should print an error log for an error with this status code.

source

pub fn from_u32(value: u32) -> Option<Self>

Trait Implementations§

source§

impl AsRef<str> for StatusCode

source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Clone for StatusCode

source§

fn clone(&self) -> StatusCode

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for StatusCode

source§

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

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

impl Display for StatusCode

source§

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

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

impl FromStr for StatusCode

source§

type Err = ParseError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<StatusCode, <Self as FromStr>::Err>

Parses a string s to return a value of this type. Read more
source§

impl IntoEnumIterator for StatusCode

source§

impl PartialEq for StatusCode

source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<&str> for StatusCode

source§

type Error = ParseError

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

fn try_from(s: &str) -> Result<StatusCode, <Self as TryFrom<&str>>::Error>

Performs the conversion.
source§

impl Copy for StatusCode

source§

impl Eq for StatusCode

source§

impl StructuralPartialEq for StatusCode

Auto Trait Implementations§

Blanket Implementations§

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<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<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

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

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

§

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

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

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

§

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

Compare self to key and return true if they are equal.
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> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

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

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

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> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
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§

default 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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