(&self, f: &mut fmt::Formatter<'_>)
| 49 | |
| 50 | impl fmt::Display for TypeError { |
| 51 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
| 52 | match self { |
| 53 | TypeError::IncompatibleTypes(t1, t2) => { |
| 54 | write!(f, "Incompatible types: {} and {}", t1, t2) |
| 55 | } |
| 56 | TypeError::InvalidCast(from, to) => { |
| 57 | write!(f, "Cannot cast from {} to {}", from, to) |
| 58 | } |
| 59 | TypeError::TypeMismatch { expected, actual } => { |
| 60 | write!(f, "Type mismatch: expected {}, got {}", expected, actual) |
| 61 | } |
| 62 | TypeError::InvalidTypeSpecification(msg) => { |
| 63 | write!(f, "Invalid type specification: {}", msg) |
| 64 | } |
| 65 | TypeError::NullabilityViolation(msg) => { |
| 66 | write!(f, "Nullability violation: {}", msg) |
| 67 | } |
| 68 | TypeError::CollectionTypeMismatch(msg) => { |
| 69 | write!(f, "Collection type mismatch: {}", msg) |
| 70 | } |
| 71 | TypeError::GraphSchemaViolation(msg) => { |
| 72 | write!(f, "Graph schema violation: {}", msg) |
| 73 | } |
| 74 | TypeError::NumericOverflow(msg) => { |
| 75 | write!(f, "Numeric overflow: {}", msg) |
| 76 | } |
| 77 | TypeError::UnknownType(name) => { |
| 78 | write!(f, "Unknown type: {}", name) |
| 79 | } |
| 80 | } |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | impl std::error::Error for TypeError {} |
nothing calls this directly
no outgoing calls
no test coverage detected