pub enum QueryError {
Syntax(String),
Semantic(String),
Type(String),
Graph(GraphError),
UnboundVariable(String),
MissingParam(String),
Cancelled,
Timeout,
ResourceLimit(String),
}Expand description
Typed error taxonomy, in three tiers that reflect when the problem was knowable:
Syntax: the query text itself is malformed — never reached planning/execution at all (parser.rs, includingpest’s own grammar failures).Semantic: the query text parsed fine but describes something structurally invalid — knowable from the query alone, no data/parameters needed (an unsupported pattern shape, an aggregate nested somewhere it can’t be,EXPLAIN EXPLAIN, …).Type: only knowable once a real value (from stored data or a$parameter) is in hand and turns out to be the wrong shape (arithmetic on a non-number, indexing a non-list, adate({...})field of the wrong type, …).
Callers that only need “did it work” (most of this codebase) keep
using Display/? as before — this tiering exists for callers that
want to react differently to “you wrote something illegal” vs “the
data didn’t match what the query assumed” (an application surfacing
user-facing messages, or ExecutionOutcome’s telemetry categories).
Variants§
Syntax(String)
Semantic(String)
Type(String)
Graph(GraphError)
UnboundVariable(String)
MissingParam(String)
Cancelled
Timeout
ResourceLimit(String)
Trait Implementations§
Source§impl Debug for QueryError
impl Debug for QueryError
Source§impl Display for QueryError
impl Display for QueryError
Source§impl Error for QueryError
impl Error for QueryError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
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
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<GraphError> for QueryError
impl From<GraphError> for QueryError
Source§fn from(source: GraphError) -> Self
fn from(source: GraphError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for QueryError
impl !UnwindSafe for QueryError
impl Freeze for QueryError
impl Send for QueryError
impl Sync for QueryError
impl Unpin for QueryError
impl UnsafeUnpin for QueryError
Blanket Implementations§
Source§impl<T> AnyExt for T
impl<T> AnyExt for T
Source§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
Attempts to downcast this to
T behind referenceSource§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
Attempts to downcast this to
T behind mutable referenceSource§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
Attempts to downcast this to
T behind Rc pointerSource§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
Attempts to downcast this to
T behind Arc pointerSource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more