Summary
Prefer non-throwing std::filesystem overloads (those taking std::error_code) instead of overloads that throw std::filesystem::filesystem_error. Then remove the try/catch around input existence checks in ImageConverter::process_image, mapping errors to existing Status / last_error_message behaviour. More broadly, apply noexcept where it is correct and consistent with the project’s style—especially on helpers that cannot throw after this migration.
Background (for newcomers)
The comment near process_image mentions catching filesystem exceptions (e.g. on Windows). The C++ standard library allows querying filesystem operations with an error_code instead of exceptions. This issue is about error handling style: avoid exception-based control flow for expected filesystem failures where possible, keep user-visible errors aligned with current enums/messages, and document any platform nuance.
Where to look
src/rawtoaces_util/image_converter.cpp — process_image try/catch around std::filesystem::exists; other std::filesystem uses in this file (e.g. output paths, directories).
src/rawtoaces_core/rawtoaces_core.cpp and src/rawtoaces_core/define.h — additional std::filesystem usage for broader consistency (scope any wide refactor carefully).
- Project C++ standard / CMake — confirm available
<filesystem> API.
Suggested direction (not a prescription)
- Replace throwing calls with
error_code overloads; branch on ec instead of catch.
- Preserve or improve
ImageConverter::Status::FilesystemError (and messages) when checks fail.
- Audit small helpers for
noexcept where failure is communicated via return/error_code only—avoid marking APIs noexcept if they can still throw from other operations unless those are removed.
Summary
Prefer non-throwing
std::filesystemoverloads (those takingstd::error_code) instead of overloads that throwstd::filesystem::filesystem_error. Then remove thetry/catcharound input existence checks inImageConverter::process_image, mapping errors to existingStatus/last_error_messagebehaviour. More broadly, applynoexceptwhere it is correct and consistent with the project’s style—especially on helpers that cannot throw after this migration.Background (for newcomers)
The comment near
process_imagementions catching filesystem exceptions (e.g. on Windows). The C++ standard library allows querying filesystem operations with anerror_codeinstead of exceptions. This issue is about error handling style: avoid exception-based control flow for expected filesystem failures where possible, keep user-visible errors aligned with current enums/messages, and document any platform nuance.Where to look
src/rawtoaces_util/image_converter.cpp—process_imagetry/catch aroundstd::filesystem::exists; otherstd::filesystemuses in this file (e.g. output paths, directories).src/rawtoaces_core/rawtoaces_core.cppandsrc/rawtoaces_core/define.h— additionalstd::filesystemusage for broader consistency (scope any wide refactor carefully).<filesystem>API.Suggested direction (not a prescription)
error_codeoverloads; branch onecinstead ofcatch.ImageConverter::Status::FilesystemError(and messages) when checks fail.noexceptwhere failure is communicated via return/error_codeonly—avoid marking APIsnoexceptif they can still throw from other operations unless those are removed.