Skip to content

Commit 25826e6

Browse files
Copilotjosecelano
andcommitted
style: apply cargo fmt formatting to error files
Co-authored-by: josecelano <[email protected]>
1 parent a129911 commit 25826e6

File tree

2 files changed

+27
-21
lines changed

2 files changed

+27
-21
lines changed

src/presentation/commands/create/errors.rs

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,14 @@ impl std::fmt::Display for ConfigFormat {
3232
#[derive(Debug, Error)]
3333
pub enum CreateSubcommandError {
3434
// ===== Configuration File Errors =====
35-
3635
/// Configuration file not found
3736
///
3837
/// The specified configuration file does not exist or is not accessible.
3938
/// Use `.help()` for detailed troubleshooting steps.
40-
#[error("Configuration file not found: {path}
41-
Tip: Check that the file path is correct: ls -la {path}")]
39+
#[error(
40+
"Configuration file not found: {path}
41+
Tip: Check that the file path is correct: ls -la {path}"
42+
)]
4243
ConfigFileNotFound {
4344
/// Path to the missing configuration file
4445
path: PathBuf,
@@ -48,8 +49,10 @@ Tip: Check that the file path is correct: ls -la {path}")]
4849
///
4950
/// The configuration file exists but could not be parsed in the expected format.
5051
/// Use `.help()` for detailed troubleshooting steps.
51-
#[error("Failed to parse configuration file '{path}' as {format}: {source}
52-
Tip: Validate {format} syntax with: jq . < {path}")]
52+
#[error(
53+
"Failed to parse configuration file '{path}' as {format}: {source}
54+
Tip: Validate {format} syntax with: jq . < {path}"
55+
)]
5356
ConfigParsingFailed {
5457
/// Path to the configuration file
5558
path: PathBuf,
@@ -64,36 +67,40 @@ Tip: Validate {format} syntax with: jq . < {path}")]
6467
///
6568
/// The configuration file was parsed successfully but contains invalid values.
6669
/// Use `.help()` for detailed troubleshooting steps.
67-
#[error("Configuration validation failed: {source}
68-
Tip: Review the validation error and fix the configuration file")]
70+
#[error(
71+
"Configuration validation failed: {source}
72+
Tip: Review the validation error and fix the configuration file"
73+
)]
6974
ConfigValidationFailed {
7075
/// Underlying validation error from domain layer
7176
#[source]
7277
source: crate::application::command_handlers::create::config::CreateConfigError,
7378
},
7479

7580
// ===== Command Execution Errors =====
76-
7781
/// Command execution failed
7882
///
7983
/// The create operation failed during execution after validation passed.
8084
/// Use `.help()` for detailed troubleshooting steps.
81-
#[error("Create command execution failed: {source}
82-
Tip: Check logs with --log-output file-and-stderr for detailed error information")]
85+
#[error(
86+
"Create command execution failed: {source}
87+
Tip: Check logs with --log-output file-and-stderr for detailed error information"
88+
)]
8389
CommandFailed {
8490
/// Underlying command handler error
8591
#[source]
8692
source: CreateCommandHandlerError,
8793
},
8894

8995
// ===== Template Generation Errors =====
90-
9196
/// Template generation failed
9297
///
9398
/// Failed to generate template configuration or files.
9499
/// Use `.help()` for detailed troubleshooting steps.
95-
#[error("Template generation failed: {source}
96-
Tip: Check that you have write permissions in the target directory")]
100+
#[error(
101+
"Template generation failed: {source}
102+
Tip: Check that you have write permissions in the target directory"
103+
)]
97104
TemplateGenerationFailed {
98105
/// Underlying template generation error from domain layer
99106
#[source]
@@ -255,11 +262,13 @@ mod tests {
255262
source: Box::new(std::io::Error::new(std::io::ErrorKind::InvalidData, "test")),
256263
},
257264
CreateSubcommandError::ConfigValidationFailed {
258-
source: CreateConfigError::InvalidEnvironmentName(EnvironmentNameError::InvalidFormat {
259-
attempted_name: "test".to_string(),
260-
reason: "invalid".to_string(),
261-
valid_examples: vec!["dev".to_string()],
262-
}),
265+
source: CreateConfigError::InvalidEnvironmentName(
266+
EnvironmentNameError::InvalidFormat {
267+
attempted_name: "test".to_string(),
268+
reason: "invalid".to_string(),
269+
valid_examples: vec!["dev".to_string()],
270+
},
271+
),
263272
},
264273
];
265274

src/presentation/commands/destroy/errors.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ use crate::domain::environment::name::EnvironmentNameError;
1717
#[derive(Debug, Error)]
1818
pub enum DestroySubcommandError {
1919
// ===== Environment Validation Errors =====
20-
2120
/// Environment name validation failed
2221
///
2322
/// The provided environment name doesn't meet the validation requirements.
@@ -41,7 +40,6 @@ Tip: Check if environment exists: ls -la {data_dir}/"
4140
EnvironmentNotAccessible { name: String, data_dir: String },
4241

4342
// ===== Repository Access Errors =====
44-
4543
/// Repository operation failed
4644
///
4745
/// Failed to create or access the environment repository.
@@ -53,7 +51,6 @@ Tip: Check directory permissions and disk space"
5351
RepositoryAccessFailed { data_dir: String, reason: String },
5452

5553
// ===== Destroy Operation Errors =====
56-
5754
/// Destroy operation failed
5855
///
5956
/// The destruction process encountered an error during execution.

0 commit comments

Comments
 (0)