Reports additional details about the error, if any are available.
(&self)
| 487 | |
| 488 | /// Reports additional details about the error, if any are available. |
| 489 | pub fn detail(&self) -> Option<String> { |
| 490 | match self { |
| 491 | AdapterError::AmbiguousSystemColumnReference => { |
| 492 | Some("This is a current limitation in Materialize".into()) |
| 493 | } |
| 494 | AdapterError::Catalog(c) => c.detail(), |
| 495 | AdapterError::Eval(e) => e.detail(), |
| 496 | AdapterError::RelationOutsideTimeDomain { relations, names } => Some(format!( |
| 497 | "The following relations in the query are outside the transaction's time domain:\n{}\n{}", |
| 498 | relations |
| 499 | .iter() |
| 500 | .map(|r| r.quoted().to_string()) |
| 501 | .collect::<Vec<_>>() |
| 502 | .join("\n"), |
| 503 | match names.is_empty() { |
| 504 | true => "No relations are available.".to_string(), |
| 505 | false => format!( |
| 506 | "Only the following relations are available:\n{}", |
| 507 | names |
| 508 | .iter() |
| 509 | .map(|name| name.quoted().to_string()) |
| 510 | .collect::<Vec<_>>() |
| 511 | .join("\n") |
| 512 | ), |
| 513 | } |
| 514 | )), |
| 515 | AdapterError::SourceOrSinkSizeRequired { .. } => Some( |
| 516 | "Either specify the cluster that will maintain this object via IN CLUSTER or \ |
| 517 | specify size via SIZE option." |
| 518 | .into(), |
| 519 | ), |
| 520 | AdapterError::InvalidTableMutationSelection { |
| 521 | object_name, |
| 522 | object_type, |
| 523 | } => Some(format!( |
| 524 | "{object_type} '{}' may not be used in this operation; \ |
| 525 | the selection may refer to views and materialized views, but transitive \ |
| 526 | dependencies must not include sources or source-export tables", |
| 527 | object_name.quoted() |
| 528 | )), |
| 529 | AdapterError::SafeModeViolation(_) => Some( |
| 530 | "The Materialize server you are connected to is running in \ |
| 531 | safe mode, which limits the features that are available." |
| 532 | .into(), |
| 533 | ), |
| 534 | AdapterError::IntrospectionDisabled { log_names } |
| 535 | | AdapterError::UntargetedLogRead { log_names } => Some(format!( |
| 536 | "The query references the following log sources:\n {}", |
| 537 | log_names.join("\n "), |
| 538 | )), |
| 539 | AdapterError::InvalidLogDependency { log_names, .. } => Some(format!( |
| 540 | "The object depends on the following log sources:\n {}", |
| 541 | log_names.join("\n "), |
| 542 | )), |
| 543 | AdapterError::PlanError(e) => e.detail(), |
| 544 | AdapterError::Unauthorized(unauthorized) => unauthorized.detail(), |
| 545 | AdapterError::DependentObject(dependent_objects) => Some( |
| 546 | dependent_objects |
no test coverage detected