-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Open
Description
#include <exception>
#include <filesystem>
#include <iostream>
#include "fmt/ostream.h"
#include "fmt/std.h"
namespace fs = std::filesystem;
int main() {
const fs::path from{"/none1/a"}, to{"/none2/b"};
try {
fs::copy_file(from, to);
} catch (fs::filesystem_error const &ex) {
std::cout << "what(): " << ex.what() << '\n'
<< "path1(): " << ex.path1() << '\n'
<< "path2(): " << ex.path2() << '\n'
<< "code().value(): " << ex.code().value() << '\n'
<< "code().message(): " << ex.code().message() << '\n'
<< "code().category(): " << ex.code().category().name() << '\n';
try {
fmt::println("{:s}", ex.code());
} catch (std::exception &e) {
fmt::println("fmt error: {}", e.what());
}
}
fmt::println("exit");
return 0;
}
Metadata
Metadata
Assignees
Labels
No labels