Skip to content

Commit

Permalink
trino: Retry based on error_name, not error_type
Browse files Browse the repository at this point in the history
The standard error output is misleading about which field is field.
  • Loading branch information
emk committed Mar 1, 2024
1 parent 65430b6 commit 775c963
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/drivers/trino/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,7 @@ impl fmt::Display for TrinoString<'_> {
/// and network errors, so we don't need to worry about that. But we do need
/// to look out for `QueryError`s that might need to be retried.
fn should_retry(e: &PrustoError) -> bool {
// Temporary debugging code to figure out why this isn't triggering.
eprintln!("Trino error: {:?}", e);
matches!(e, PrustoError::QueryError(QueryError { error_type, .. }) if error_type == "NO_NODES_AVAILABLE")
matches!(e, PrustoError::QueryError(QueryError { error_name, .. }) if error_name == "NO_NODES_AVAILABLE")
}

/// These errors are pages long.
Expand Down

0 comments on commit 775c963

Please sign in to comment.