diff options
| author | Stefan Boberg <[email protected]> | 2021-09-15 15:23:47 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-09-15 15:23:47 +0200 |
| commit | f34aa060d7da16d4e08644cf8572db979f3ea8d0 (patch) | |
| tree | c7c5e5f961c971e2c8e93f542241c7817aa9e3fb /zen/cmds/copy.cpp | |
| parent | Made logging macros always append `sv` string_view literal suffix (diff) | |
| download | archived-zen-f34aa060d7da16d4e08644cf8572db979f3ea8d0.tar.xz archived-zen-f34aa060d7da16d4e08644cf8572db979f3ea8d0.zip | |
Changed `std::exception` into `std::runtime_error` since `std::exception` does not have a constructor which accepts a string argument in the standard (this appears to be an MSVC implementation thing)
Diffstat (limited to 'zen/cmds/copy.cpp')
| -rw-r--r-- | zen/cmds/copy.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/zen/cmds/copy.cpp b/zen/cmds/copy.cpp index 2830f8c28..4ce09c982 100644 --- a/zen/cmds/copy.cpp +++ b/zen/cmds/copy.cpp @@ -37,10 +37,10 @@ CopyCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) // Validate arguments if (m_CopySource.empty()) - throw std::exception("No source specified"); + throw std::runtime_error("No source specified"); if (m_CopyTarget.empty()) - throw std::exception("No target specified"); + throw std::runtime_error("No target specified"); std::filesystem::path FromPath; std::filesystem::path ToPath; @@ -53,12 +53,12 @@ CopyCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) if (!IsFileCopy && !IsDirCopy) { - throw std::exception("Invalid source specification (neither directory nor file)"); + throw std::runtime_error("Invalid source specification (neither directory nor file)"); } if (IsFileCopy && IsDirCopy) { - throw std::exception("Invalid source specification (both directory AND file!?)"); + throw std::runtime_error("Invalid source specification (both directory AND file!?)"); } if (IsDirCopy) @@ -70,7 +70,7 @@ CopyCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) { if (std::filesystem::is_regular_file(ToPath)) { - throw std::exception("Attempted copy of directory into file"); + throw std::runtime_error("Attempted copy of directory into file"); } } } |