aboutsummaryrefslogtreecommitdiffstats
path: root/libdevcore
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-06-22 04:46:56 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-06-22 18:25:06 +0800
commita3bd670154da3c8cc153da4b2535cd3012d75885 (patch)
tree4806dfa6a625ae2d07de5c36bbfb6f1df3833186 /libdevcore
parentbecea47ac3066c7d8d448d0e428cd84d351061e3 (diff)
downloaddexon-solidity-a3bd670154da3c8cc153da4b2535cd3012d75885.tar
dexon-solidity-a3bd670154da3c8cc153da4b2535cd3012d75885.tar.gz
dexon-solidity-a3bd670154da3c8cc153da4b2535cd3012d75885.tar.bz2
dexon-solidity-a3bd670154da3c8cc153da4b2535cd3012d75885.tar.lz
dexon-solidity-a3bd670154da3c8cc153da4b2535cd3012d75885.tar.xz
dexon-solidity-a3bd670154da3c8cc153da4b2535cd3012d75885.tar.zst
dexon-solidity-a3bd670154da3c8cc153da4b2535cd3012d75885.zip
Remove obscure DEV_IGNORE_EXCEPTIONS macro
Diffstat (limited to 'libdevcore')
-rw-r--r--libdevcore/Common.h2
-rw-r--r--libdevcore/CommonIO.cpp16
2 files changed, 14 insertions, 4 deletions
diff --git a/libdevcore/Common.h b/libdevcore/Common.h
index dc981ff6..c5b09a80 100644
--- a/libdevcore/Common.h
+++ b/libdevcore/Common.h
@@ -76,8 +76,6 @@ using byte = uint8_t;
#define DEV_QUOTED_HELPER(s) #s
#define DEV_QUOTED(s) DEV_QUOTED_HELPER(s)
-#define DEV_IGNORE_EXCEPTIONS(X) try { X; } catch (...) {}
-
namespace dev
{
diff --git a/libdevcore/CommonIO.cpp b/libdevcore/CommonIO.cpp
index 97505b54..52829455 100644
--- a/libdevcore/CommonIO.cpp
+++ b/libdevcore/CommonIO.cpp
@@ -78,12 +78,24 @@ void dev::writeFile(std::string const& _file, bytesConstRef _data, bool _writeDe
if (!fs::exists(p.parent_path()))
{
fs::create_directories(p.parent_path());
- DEV_IGNORE_EXCEPTIONS(fs::permissions(p.parent_path(), fs::owner_all));
+ try
+ {
+ fs::permissions(p.parent_path(), fs::owner_all);
+ }
+ catch (...)
+ {
+ }
}
ofstream s(_file, ios::trunc | ios::binary);
s.write(reinterpret_cast<char const*>(_data.data()), _data.size());
assertThrow(s, FileError, "Could not write to file: " + _file);
- DEV_IGNORE_EXCEPTIONS(fs::permissions(_file, fs::owner_read|fs::owner_write));
+ try
+ {
+ fs::permissions(_file, fs::owner_read|fs::owner_write);
+ }
+ catch (...)
+ {
+ }
}
}