nushell/crates/nu-protocol/src/shell_error.rs

26 lines
664 B
Rust
Raw Normal View History

2021-09-05 23:16:27 +00:00
use crate::{ast::Operator, Span, Type};
2021-09-02 01:29:43 +00:00
2021-09-05 23:16:27 +00:00
#[derive(Debug, Clone)]
2021-09-02 01:29:43 +00:00
pub enum ShellError {
OperatorMismatch {
op_span: Span,
lhs_ty: Type,
lhs_span: Span,
rhs_ty: Type,
rhs_span: Span,
},
2021-09-05 23:16:27 +00:00
UnsupportedOperator(Operator, Span),
UnknownOperator(String, Span),
ExternalNotSupported(Span),
2021-09-02 01:29:43 +00:00
InternalError(String),
2021-09-06 02:20:02 +00:00
VariableNotFoundAtRuntime(Span),
2021-09-02 01:29:43 +00:00
CantConvert(String, Span),
DivisionByZero(Span),
2021-09-06 04:07:48 +00:00
CannotCreateRange(Span),
2021-09-06 22:02:24 +00:00
AccessBeyondEnd(usize, Span),
AccessBeyondEndOfStream(Span),
IncompatiblePathAccess(String, Span),
CantFindColumn(Span),
2021-09-19 19:29:58 +00:00
ExternalCommand(String, Span),
2021-09-02 01:29:43 +00:00
}