chore(etherscan): add cloudflare captcha error (#2116)
This commit is contained in:
parent
2fce943274
commit
56cc3e674a
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
//! Bindings for [etherscan.io web api](https://docs.etherscan.io/)
|
||||
|
||||
use crate::errors::is_blocked_by_cloudflare_response;
|
||||
use crate::errors::{is_blocked_by_cloudflare_response, is_cloudflare_security_challenge};
|
||||
use contract::ContractMetadata;
|
||||
use errors::EtherscanError;
|
||||
use ethers_core::{
|
||||
|
@ -209,6 +209,8 @@ impl Client {
|
|||
error!(target: "etherscan", ?res, "Failed to deserialize response: {}", err);
|
||||
if is_blocked_by_cloudflare_response(res) {
|
||||
EtherscanError::BlockedByCloudflare
|
||||
} else if is_cloudflare_security_challenge(res) {
|
||||
EtherscanError::CloudFlareSecurityChallenge
|
||||
} else {
|
||||
EtherscanError::Serde(err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue