Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate Legacy Node (Frontend) *DO NOT MERGE* #4908

Draft
wants to merge 21 commits into
base: feature/directory-v3-purge-base
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
resolved first batch of 500 compiler errors
  • Loading branch information
jstuczyn authored and fmtabbara committed Sep 22, 2024
commit 05c1a540ef6769f9b44b3ae1a5940c648ce4a029
48 changes: 36 additions & 12 deletions nym-api/src/node_status_api/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,23 +375,47 @@ impl AxumErrorResponse {
}
}

pub(crate) fn internal_server_error() -> Self {
RocketErrorResponse {
error_message: RequestError::new(
"experienced an internal server error and could not complete this request",
),
status: Status::InternalServerError,
pub(crate) fn internal() -> Self {
Self {
message: RequestError::new("Internal server error"),
status: StatusCode::INTERNAL_SERVER_ERROR,
}
}

pub(crate) fn not_implemented() -> Self {
Self {
message: RequestError::empty(),
status: StatusCode::NOT_IMPLEMENTED,
}
}

pub(crate) fn not_found(msg: impl Display) -> Self {
Self {
message: RequestError::new(msg.to_string()),
status: StatusCode::NOT_FOUND,
}
}

pub(crate) fn service_unavailable() -> Self {
Self {
message: RequestError::empty(),
status: StatusCode::SERVICE_UNAVAILABLE,
}
}

pub(crate) fn unprocessable_entity(msg: impl Display) -> Self {
Self {
message: RequestError::new(msg.to_string()),
status: StatusCode::UNPROCESSABLE_ENTITY,
}
}
}

impl From<UninitialisedCache> for RocketErrorResponse {
impl From<UninitialisedCache> for AxumErrorResponse {
fn from(_: UninitialisedCache) -> Self {
RocketErrorResponse {
error_message: RequestError::new(
"one of the internal caches hasn't yet been initialised",
),
status: Status::ServiceUnavailable,
AxumErrorResponse {
message: RequestError::new("relevant cache hasn't been initialised yet"),
status: StatusCode::SERVICE_UNAVAILABLE,
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions nym-api/src/support/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ use nym_mixnet_contract_common::NodeId;
use nym_types::monitoring::NodeResult;
use sqlx::ConnectOptions;
use std::path::Path;
<<<<<<< HEAD
use time::{Date, OffsetDateTime};
=======
use time::OffsetDateTime;
>>>>>>> 16a2aaf6b (resolved first batch of 500 compiler errors)
use tracing::{error, info, warn};

use self::manager::{AvgGatewayReliability, AvgMixnodeReliability};
Expand Down