chore: fix lints

pull/24376/head
Dom 2021-01-13 18:07:19 +00:00
parent 81802abb8e
commit 30d5857fd4
2 changed files with 6 additions and 6 deletions

View File

@ -205,19 +205,19 @@ impl ApplicationError {
use influxdb_iox_client::errors::ApiErrorCode;
match self {
ApplicationError::DatabaseNameError { .. } => ApiErrorCode::DB_INVALID_NAME,
ApplicationError::DatabaseNotFound { .. } => ApiErrorCode::DB_NOT_FOUND,
Self::DatabaseNameError { .. } => ApiErrorCode::DB_INVALID_NAME,
Self::DatabaseNotFound { .. } => ApiErrorCode::DB_NOT_FOUND,
// Some errors are wrapped
ApplicationError::ErrorCreatingDatabase {
Self::ErrorCreatingDatabase {
source: server::Error::InvalidDatabaseName { .. },
} => ApiErrorCode::DB_INVALID_NAME,
ApplicationError::ErrorCreatingDatabase {
Self::ErrorCreatingDatabase {
source: server::Error::DatabaseNotFound { .. },
} => ApiErrorCode::DB_NOT_FOUND,
ApplicationError::ErrorCreatingDatabase {
Self::ErrorCreatingDatabase {
source: server::Error::DatabaseAlreadyExists { .. },
} => ApiErrorCode::DB_ALREADY_EXISTS,

View File

@ -444,7 +444,7 @@ async fn test_http_error_messages(client: &influxdb2_client::Client) -> Result<(
.await
.expect_err("Should have errored");
let expected_error = "HTTP request returned an error: 400 Bad Request, `{\"error\":\"Error parsing line protocol: A generic parsing error occurred: TakeWhile1\"}`";
let expected_error = "HTTP request returned an error: 400 Bad Request, `{\"error\":\"Error parsing line protocol: A generic parsing error occurred: TakeWhile1\",\"error_code\":100}`";
assert_eq!(result.to_string(), expected_error);
Ok(())