|
Libmagicxx v10.0.3
A modern C++23 wrapper for libmagic — the library that powers the Unix file command.
|
Exception hierarchy for the Magic file identification library. More...
#include <format>#include <stdexcept>#include <string>

Go to the source code of this file.
Classes | |
| class | Recognition::MagicException |
| Base exception class for all Magic-related errors. More... | |
| class | Recognition::NullTracker |
| Exception thrown when a shared ProgressTracker is null. More... | |
| class | Recognition::EmptyPath |
| Exception thrown when a path argument is empty. More... | |
| class | Recognition::PathIsNotRegularFile |
| Exception thrown when a path is expected to be a regular file but is not. More... | |
| class | Recognition::PathIsNotDirectory |
| Exception thrown when a path is expected to be a directory but is not. More... | |
| class | Recognition::PathDoesNotExist |
| Exception thrown when a specified path does not exist. More... | |
| class | Recognition::FilesystemError |
| Exception thrown when a filesystem operation fails. More... | |
| class | Recognition::MagicIsClosed |
| Exception thrown when an operation is attempted on a closed Magic instance. More... | |
| class | Recognition::MagicOpenError |
| Exception thrown when Magic::Open() fails. More... | |
| class | Recognition::MagicLoadDatabaseFileError |
| Exception thrown when Magic::LoadDatabaseFile() fails. More... | |
| class | Recognition::MagicDatabaseNotLoaded |
| Exception thrown when file identification is attempted without a loaded database. More... | |
| class | Recognition::MagicIdentifyFileError |
| Exception thrown when file type identification fails. More... | |
| class | Recognition::MagicSetFlagsError |
| Exception thrown when Magic::SetFlags() fails. More... | |
| class | Recognition::MagicSetParameterError |
| Exception thrown when Magic::SetParameter() fails. More... | |
Namespaces | |
| namespace | Recognition |
| Root namespace for the libmagicxx library. | |
Exception hierarchy for the Magic file identification library.
This file defines the exception classes used by the Magic class to report errors. All exceptions derive from MagicException, which itself derives from std::runtime_error.
Catch specific exceptions for targeted error handling:
Or use noexcept overloads to avoid exceptions entirely: