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

use stop() whenever an error is logged with logger::log_error() #55

Merged
merged 1 commit into from
Apr 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions main.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ if (fs::dir_exists(scenario_preparation_inputs_path)) {
logger::log_info("Setting scenario preparation inputs path: {scenario_preparation_inputs_path}")
} else {
logger::log_error("Scenario preparation inputs path does not exist: {scenario_preparation_inputs_path}")
stop()
}


Expand All @@ -24,6 +25,7 @@ if (fs::dir_exists(scenario_preparation_outputs_path)) {
logger::log_info("Setting scenario preparation outputs path: {scenario_preparation_outputs_path}")
} else {
logger::log_error("Scenario preparation outputs path does not exist: {scenario_preparation_outputs_path}")
stop()
}


Expand Down
1 change: 1 addition & 0 deletions process_scenario_geco_2022.R
Original file line number Diff line number Diff line change
Expand Up @@ -275,4 +275,5 @@ if (pacta.data.validation::validate_intermediate_scenario_output(geco_2022)) {

} else {
logger::log_error("GECO 2022: GECO 2022 data is not valid.")
stop()
}
5 changes: 3 additions & 2 deletions process_scenario_geco_2023.R
Original file line number Diff line number Diff line change
Expand Up @@ -206,14 +206,15 @@ if (pacta.data.validation::validate_intermediate_scenario_output(geco_2023)) {
logger::log_info("GECO 2023: GECO 2023 data is valid.")

output_path <- fs::path(scenario_preparation_outputs_path, "geco_2023.csv")

readr::write_csv(
x = geco_2023,
file = output_path
)

logger::log_info("GECO 2023: GECO 2023 data saved to {output_path}.")

} else {
logger::log_error("GECO 2023 data is not valid.")
stop()
}
1 change: 1 addition & 0 deletions process_scenario_isf_2021.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,5 @@ if (pacta.data.validation::validate_intermediate_scenario_output(isf_2021)) {

} else {
logger::log_error("ISF 2021 data is not valid.")
stop()
}
1 change: 1 addition & 0 deletions process_scenario_isf_2023.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,5 @@ if (pacta.data.validation::validate_intermediate_scenario_output(isf_2023)) {

} else {
logger::log_error("ISF 2023 data is not valid.")
stop()
}
1 change: 1 addition & 0 deletions process_scenario_weo_2022.R
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,5 @@ if (pacta.data.validation::validate_intermediate_scenario_output(weo_2022)) {

} else {
logger::log_error("WEO 2022 data is not valid.")
stop()
}
1 change: 1 addition & 0 deletions process_scenario_weo_2023.R
Original file line number Diff line number Diff line change
Expand Up @@ -122,4 +122,5 @@ if (pacta.data.validation::validate_intermediate_scenario_output(weo_2023)) {

} else {
logger::log_error("WEO 2023 data is not valid.")
stop()
}
Loading