MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / check_error

Function check_error

test/test-util/src/mz_client.rs:74–81  ·  view source on GitHub ↗

The SQL_STATEMENT_NOT_YET_COMPLETE error will surface if we query a view in Materialize before data exists for that view. It is common to hit this error just after creating a view, particularly in testing or demo code. Since this error is likely transient, we should retry reading from the view instead of failing.

(e: Error)

Source from the content-addressed store, hash-verified

72/// Since this error is likely transient, we should retry reading from the view
73/// instead of failing.
74fn check_error(e: Error) -> Result<()> {
75 if e.code() == Some(&SqlState::SQL_STATEMENT_NOT_YET_COMPLETE) {
76 info!("Error querying, will try again... {}", e.to_string());
77 Ok(())
78 } else {
79 Err(anyhow::Error::from(e))
80 }
81}
82
83/// Limit the queries per second against a view in Materialize.
84async fn delay_for(elapsed: Duration, delay: Duration) {

Callers 2

try_queryFunction · 0.70
try_query_oneFunction · 0.70

Calls 1

codeMethod · 0.45

Tested by

no test coverage detected