diff --git a/src/routing/error_cause.rs b/src/routing/error_cause.rs index 841608d..9c9692d 100644 --- a/src/routing/error_cause.rs +++ b/src/routing/error_cause.rs @@ -64,7 +64,7 @@ pub enum ErrorCause { CanisterIdNotResolved, CanisterRouteNotFound, SubnetNotFound, - SubnetUnavailable(String), + SubnetUnavailable, NoRoutingTable, ResponseVerificationError, HttpGatewayError(String), @@ -194,7 +194,7 @@ impl From<&BNResponseMetadata> for Option { } Some(match v.error_cause.as_ref() { - NO_HEALTHY_NODES => ErrorCause::SubnetUnavailable(v.subnet_id.clone()), + NO_HEALTHY_NODES => ErrorCause::SubnetUnavailable, CANISTER_NOT_FOUND | CANISTER_ROUTE_NOT_FOUND => ErrorCause::CanisterRouteNotFound, SUBNET_NOT_FOUND => ErrorCause::SubnetNotFound, FORBIDDEN => ErrorCause::Forbidden, @@ -270,7 +270,7 @@ pub enum ErrorClientFacing { CanisterIdIncorrect, SubnetNotFound, #[strum(serialize = "subnet_updating")] - SubnetUnavailable(String), + SubnetUnavailable, ResponseVerificationError, Denylisted, Forbidden, @@ -298,7 +298,7 @@ impl ErrorClientFacing { Self::CanisterIdNotResolved => StatusCode::BAD_REQUEST, Self::CanisterIdIncorrect => StatusCode::BAD_REQUEST, Self::SubnetNotFound => StatusCode::BAD_REQUEST, - Self::SubnetUnavailable(_) => StatusCode::SERVICE_UNAVAILABLE, + Self::SubnetUnavailable => StatusCode::SERVICE_UNAVAILABLE, Self::ResponseVerificationError => StatusCode::SERVICE_UNAVAILABLE, Self::Denylisted => StatusCode::UNAVAILABLE_FOR_LEGAL_REASONS, Self::Forbidden => StatusCode::FORBIDDEN, @@ -325,7 +325,7 @@ impl ErrorClientFacing { Self::CanisterIdNotResolved => "HTTP gateway wasn't able to resolve the ID of the canister where to send the request.".into(), Self::CanisterIdIncorrect => "The canister ID is incorrect".into(), Self::SubnetNotFound => "The requested subnet was not found.".into(), - Self::SubnetUnavailable(_) => "This part of the Internet Computer is currently upgrading. It should be back in a couple of minutes. No worries – your data is safe! Please try again later.".into(), + Self::SubnetUnavailable => "This part of the Internet Computer is currently upgrading. It should be back in a couple of minutes. No worries – your data is safe! Please try again later.".into(), Self::ResponseVerificationError => "The response from the canister failed verification and cannot be trusted.\nIf you understand the risks, you can retry using the raw domain to bypass certification.".into(), Self::Denylisted => "Access to this resource is denied due to a violation of the code of conduct.".into(), Self::Forbidden => "Access to this resource is denied by the current set of application firewall rules.".into(), @@ -345,11 +345,6 @@ impl ErrorClientFacing { pub fn html(&self) -> String { match self { Self::Denylisted => include_str!("error_pages/451.html").to_string(), - Self::SubnetUnavailable(subnet) - if subnet == "uzr34-akd3s-xrdag-3ql62-ocgoh-ld2ao-tamcv-54e7j-krwgb-2gm4z-oqe" => - { - include_str!("error_pages/identity.html").to_string() - } _ => { let template = ERROR_PAGE_TEMPLATE; let template = template.replace("{status_code}", self.status_code().as_str()); @@ -381,7 +376,7 @@ impl From<&ErrorCause> for ErrorClientFacing { ErrorCause::CanisterIdNotResolved => Self::CanisterIdNotResolved, ErrorCause::CanisterIdIncorrect(_) => Self::CanisterIdIncorrect, ErrorCause::SubnetNotFound => Self::SubnetNotFound, - ErrorCause::SubnetUnavailable(x) => Self::SubnetUnavailable(x.clone()), + ErrorCause::SubnetUnavailable => Self::SubnetUnavailable, ErrorCause::ResponseVerificationError => Self::ResponseVerificationError, ErrorCause::DomainCanisterMismatch => Self::DomainCanisterMismatch, ErrorCause::Denylisted => Self::Denylisted, @@ -446,10 +441,7 @@ mod test { // Mapping of "error_cause" BN headers let cases = [ - ( - NO_HEALTHY_NODES, - Some(ErrorCause::SubnetUnavailable("".into())), - ), + (NO_HEALTHY_NODES, Some(ErrorCause::SubnetUnavailable)), (NO_ROUTING_TABLE, Some(ErrorCause::NoRoutingTable)), (FORBIDDEN, Some(ErrorCause::Forbidden)), (LOAD_SHED, Some(ErrorCause::LoadShed)), diff --git a/src/routing/error_pages/identity.html b/src/routing/error_pages/identity.html deleted file mode 100644 index 3dde2d7..0000000 --- a/src/routing/error_pages/identity.html +++ /dev/null @@ -1,400 +0,0 @@ - - - - Internet Identity is temporarily unavailable - - - - - - -
- -
-
- - - -

Internet Identity

-
-
- - -
-
-

Internet Identity is temporarily unavailable

-

- The subnet that hosts Internet Identity (II) is undergoing scheduled - maintenance to back up the vetKeys production key. -

-

Estimated downtime: 5–10 minutes

-

Please try again shortly.

-

- Note: Existing sessions remain active and dapps that rely on II will - continue to function as normal. -

-

- More information ➔ -

-
-
-
- -