diff options
Diffstat (limited to 'src/util.cc')
| -rw-r--r-- | src/util.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/util.cc b/src/util.cc index 757553ae..11fcda27 100644 --- a/src/util.cc +++ b/src/util.cc @@ -455,3 +455,26 @@ boost::filesystem::path dcp::resources_directory () } +void +dcp::maybe_throw_from_asdcplib(Kumu::Result_t result, boost::filesystem::path path) +{ + switch (result.OsError()) { + +#ifdef LIBDCP_WINDOWS + case ERROR_DISK_FULL: + case ERROR_HANDLE_DISK_FULL: +#else + case EDQUOT: + case ENOSPC: +#endif + boost::throw_exception(DiskFullError(path)); + +#ifdef LIBDCP_WINDOWS + case ERROR_TOO_MANY_OPEN_FILES: +#else + case EMFILE: +#endif + boost::throw_exception(TooManyOpenFilesError()); + } +} + |
