summaryrefslogtreecommitdiffhomepage
path: root/anim
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-06-11 12:29:18 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-06-11 12:29:18 +0200
commit47e74a258fb73c284efb17e1697ea0c6f3cde550 (patch)
tree80f6ec06fd06f0798fe05c0816b491a3f365257e /anim
parenta7187fa1a4d3f816c8ad2fc865a19b26a41d05f1 (diff)
a
Diffstat (limited to 'anim')
-rw-r--r--anim/serialize.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/anim/serialize.cpp b/anim/serialize.cpp
index 3aca6201..be29dd28 100644
--- a/anim/serialize.cpp
+++ b/anim/serialize.cpp
@@ -7,7 +7,6 @@
#include <Corrade/Utility/Debug.h>
#include <Corrade/Utility/DebugStl.h>
-using Corrade::Utility::Debug;
using Corrade::Utility::Error;
namespace nlohmann {
@@ -44,7 +43,7 @@ std::tuple<anim, bool> anim::from_json(const std::filesystem::path& pathname)
try {
s.open(pathname, std::ios_base::in);
} catch (const std::ios::failure& e) {
- Error{} << "failed to open" << pathname << ':' << e.what();
+ Error{Error::Flag::NoSpace} << "failed to open '" << pathname << "':" << e.what();
return { {}, false };
}
anim ret;
@@ -54,7 +53,7 @@ std::tuple<anim, bool> anim::from_json(const std::filesystem::path& pathname)
using nlohmann::from_json;
from_json(j, ret);
} catch (const std::exception& e) {
- Error{} << "failed to parse" << pathname << ':' << e.what();
+ Error{Error::Flag::NoSpace} << "failed to parse '" << pathname << "':" << e.what();
return { {}, false };
}
return { std::move(ret), true };
@@ -69,14 +68,14 @@ bool anim::to_json(const std::filesystem::path& pathname)
try {
s.open(pathname, std::ios_base::out | std::ios_base::trunc);
} catch (const std::ios::failure& e) {
- Error{} << "failed to open" << pathname << "for writing:" << e.what();
+ Error{Error::Flag::NoSpace} << "failed to open '" << pathname << "' for writing: " << e.what();
return false;
}
try {
s << j.dump(4);
s.flush();
} catch (const std::exception& e) {
- Error{} << "failed writing" << pathname << ':' << e.what();
+ Error{Error::Flag::NoSpace} << "failed writing '" << pathname << "' :" << e.what();
return false;
}