Enum warpgrapher::Error [−][src]
pub enum Error {}Show variants
ClientRequestFailed { source: Error, }, ConfigItemDuplicated { type_name: String, }, ConfigItemReserved { type_name: String, }, ConfigOpenFailed { source: Error, }, ConfigVersionMismatched { expected: i32, found: i32, }, DatabaseNotFound, JsonDeserializationFailed { source: Error, }, EnvironmentVariableNotFound { name: String, }, EnvironmentVariableBoolNotParsed { source: ParseBoolError, }, EnvironmentVariableIntNotParsed { source: ParseIntError, }, EventError { source: Box<dyn Error + Sync + Send>, }, InputItemNotFound { name: String, }, InvalidHeaderName { source: InvalidHeaderName, }, InvalidHeaderValue { source: InvalidHeaderValue, }, LabelNotFound, PartitionKeyNotFound, PayloadNotFound { response: Value, }, RelDuplicated { rel_name: String, ids: String, }, ResolverNotFound { name: String, }, ResponseSetNotFound, ResponseItemNotFound { name: String, }, SerializationFailed { source: Error, }, SchemaItemNotFound { name: String, }, ThreadCommunicationFailed { source: RecvError, }, TransactionFinished, TypeConversionFailed { src: String, dst: String, }, TypeNotExpected { details: Option<String>, }, UserDefinedError { source: Box<dyn Error + Sync + Send>, }, UuidNotParsed { source: Error, }, ValidationFailed { message: String, }, ValidatorNotFound { name: String, }, YamlDeserializationFailed { source: Error, },
Error type for Warpgrapher
Examples
use serde_json::json; use warpgrapher::Error; let e = Error::PayloadNotFound { response: json!{"surprise"} };
Variants
Returned if a Client
is unable to submit a request to the server, such as due to a
network or server error, or the response cannot be parsed as valid JSON. Inspect the
reqwest::Error
included as a source error for additional detail.
Show fields
Fields of ClientRequestFailed
source: Error
Returned if two Warpgrapher endpoints or two Warpgrapher types are defined with the same
name. The type_name
field contains the name of the duplicated type.
Show fields
Fields of ConfigItemDuplicated
type_name: String
Returned if a Warpgrapher endpoint or type is defined with a name that is a reserved
word, such as “ID” or a GraphQL scalar. The field type_name
is the name that triggered the
error.
Show fields
Fields of ConfigItemReserved
type_name: String
Returned if a Config
file cannot be opened, typically because the configuration file
cannot be found on disk
Show fields
Fields of ConfigOpenFailed
source: Error
Returned if attempting to compose configs with different versions. The field expected
contains the version of the base Config
, and found
contains the version of the Config
being merged in.
Returned if the engine is configured to operate without a database. Typically this would never be done in production
Returned if a serde_json::Value
struct fails to deserialize into a struct
Show fields
Fields of JsonDeserializationFailed
source: Error
Returned if an environment variable cannot be found. The name
field contains the name of
the environment variable that could not be found.
Show fields
Fields of EnvironmentVariableNotFound
name: String
Returned if an environemtn variable for a boolean flag cannot be parsed from the environment variable string into a bool
Show fields
Fields of EnvironmentVariableBoolNotParsed
source: ParseBoolError
Returned if an environment variable for a port number cannot be parsed from the environment variable string into a number
Show fields
Fields of EnvironmentVariableIntNotParsed
source: ParseIntError
Returned if a registered extension function returns an error
Returned if a GraphQL query is missing an expected argument. For example, if a create mutation call were missing its input argument. Also returned if an input argument is missing an expected field.
Show fields
Fields of InputItemNotFound
name: String
Returned if an invalid header is passed to the constructor for creating an http client. There are two possible invalid header types based on whether the name or value was invalid.
Show fields
Fields of InvalidHeaderName
source: InvalidHeaderName
Show fields
Fields of InvalidHeaderValue
source: InvalidHeaderValue
Returned if an internal CRUD handler tries to retrieve the label for a node or relationship from an internal temporary bookkeeping structure and is unable to do so. This almost certainly indicates an internal bug. Thus, if you happen to see it, please open an issue at the Warpgrapher project.
Returned if a partition key is None
for a database back-end that requires one, such as
Cosmos DB
Returned if a Client
receives a valid JSON response that does not contain the
expected ‘data’ or ‘errors’ objects.
The serde_json::Value
tuple value contains the deserialized JSON response.
Show fields
Fields of PayloadNotFound
response: Value
Return if a query tries to read and return a relationship defined in the GraphQL schema as
being a single relationship (one-to-one), for which the back-end database has multiple
outgoing relationship edges (one-to-many or many-to-many). The rel_name
field holds the
name of the relationship, and the ids
field holds a list of ids of the relationships
found.
Returned if a custom endpoint is defined or a resolver is defined for a field, but the
corresponding resolver is not provided. The name
field contains the name of the resolver
that could not be found.
Show fields
Fields of ResolverNotFound
name: String
Returned if a database query is missing a set of results altogether, where one is expected. This likely indicates an internal bug. Thus, if you happen to see it, please open an issue at the Warpgrapher project.
Returned if a database query result is missing an expected property. For example, if a Cosmos DB query were to be missing the value for a property, or if the query fails to to return an expected node or relationship. This could occur if a custom resolver creates a node or rel witout adding mandatory properties, such as an ID.
Show fields
Fields of ResponseItemNotFound
name: String
Returned if a GraphQL response or a database query parameter cannot be converted to a serde_json::Value, or if a query
Show fields
Fields of SerializationFailed
source: Error
Returned if Warpgrapher fails to find an element within a schema, such as a type or property. This is very unlikely to be returned as a result of problems with inputs to the engine and most likely indicates an internal bug. Thus, if you happen to see it, please open an issue at the Warpgrapher project. The field is the name of the schema element that could not be fiound.
Show fields
Fields of SchemaItemNotFound
name: String
When the Warpgrapher client sends queries to a local instance of a Warpgrapher engine, it runs the engine in a separate thread, where it can have its own tokio execution context. This error indicates an error in receiving the query answer from the engine thread.
Show fields
Fields of ThreadCommunicationFailed
source: RecvError
Returned if a transaction is used after it is committed or rolled back.
Warpgrapher transforms data between different serialization formats in the course of
relaying data between GraphQL and database back-ends. If data fails to convert successfully,
this error is thrown. The src
field contains the source type name or value that could not
be converted.
Returned in multiple circumstances if the type information associated with a Value
is
inconsistent with the type required. Examples include:
- a Warpgrapher
Value
enum doesn’t match the variant expected for a given property, such as an ID represented by something other than a string value - a configuration schema is parsed incorrectly, resulting in an unexpected GraphQL endpoint input argument
This error could be returned if a custom resolver creates a node or relationship with a property of a type that doesn’t match the type in the schema, such a creating an integer property where the schema configures Warpgrapher to expect a string. However, other than that case, this error most likely indicates an internal bug for which an issue should be opened at the Warpgrapher project.
Returned when encapsulating an error thrown in event handlers provided by users of Warpgrapher
Returned if the String argument for an id cannot be parsed into a UUID
Show fields
Fields of UuidNotParsed
source: Error
This error is returned by a custom input validator when the validation fails. The message String describes the reason the field failed validation.
Show fields
Fields of ValidationFailed
message: String
Returned if a custom input validator is defined, but the corresponding validator is not
provided. The name
field contains the name of the validator that wasn’t found.
Show fields
Fields of ValidatorNotFound
name: String
Returned if a serde_yaml::Value
struct fails to deserialize into a given struct
Show fields
Fields of YamlDeserializationFailed
source: Error
Trait Implementations
impl Error for Error
[src]
impl Error for Error
[src]fn source(&self) -> Option<&(dyn Error + 'static)>
[src]
fn source(&self) -> Option<&(dyn Error + 'static)>
[src]The lower-level source of this error, if any. Read more
fn backtrace(&self) -> Option<&Backtrace>
[src]
fn backtrace(&self) -> Option<&Backtrace>
[src]backtrace
)Returns a stack backtrace, if available, of where this error occurred. Read more
fn description(&self) -> &str
1.0.0[src]
fn description(&self) -> &str
1.0.0[src]use the Display impl or to_string()
impl From<ParseBoolError> for Error
[src]
impl From<ParseBoolError> for Error
[src]fn from(e: ParseBoolError) -> Self
[src]
fn from(e: ParseBoolError) -> Self
[src]Performs the conversion.
impl From<ParseIntError> for Error
[src]
impl From<ParseIntError> for Error
[src]fn from(e: ParseIntError) -> Self
[src]
fn from(e: ParseIntError) -> Self
[src]Performs the conversion.
impl From<TryFromIntError> for Error
[src]
impl From<TryFromIntError> for Error
[src]fn from(_e: TryFromIntError) -> Self
[src]
fn from(_e: TryFromIntError) -> Self
[src]Performs the conversion.
Auto Trait Implementations
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Instrument for T
[src]
impl<T> Instrument for T
[src]fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
fn in_current_span(self) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,