Skip to content

Commit 272e60d

Browse files
committed
Account for more invalid api key cases
1 parent 2a81c19 commit 272e60d

File tree

1 file changed

+2
-1
lines changed
  • crates/block-explorers/src

1 file changed

+2
-1
lines changed

crates/block-explorers/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,8 @@ impl Client {
245245
if let Some(ref result) = result {
246246
if result.starts_with("Max rate limit reached") {
247247
return Err(EtherscanError::RateLimitExceeded);
248-
} else if result.to_lowercase() == "invalid api key" {
248+
}
249+
if result.to_lowercase().contains("invalid api key") {
249250
return Err(EtherscanError::InvalidApiKey);
250251
}
251252
}

0 commit comments

Comments
 (0)