From c1c317014002311874006f319b04121c88ef4672 Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Fri, 5 Jun 2026 09:05:03 +0200 Subject: magic: improve error handling --- cabinet/magic.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cabinet/magic.hpp') diff --git a/cabinet/magic.hpp b/cabinet/magic.hpp index 96f4b08..9e078de 100644 --- a/cabinet/magic.hpp +++ b/cabinet/magic.hpp @@ -54,10 +54,12 @@ namespace cab auto operator=(magic const &) -> magic & = delete; auto operator=(magic && other) noexcept -> magic &; - auto process(std::filesystem::path path) -> std::expected; - auto process(int file_descriptor) -> std::expected; + auto process(std::filesystem::path path) -> std::expected; + auto process(int file_descriptor) -> std::expected; private: + auto handle_result(char const * result) -> std::expected; + explicit magic(::magic_t cookie) noexcept; ::magic_t m_cookie{}; -- cgit v1.2.3