2 Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 /** @file src/exceptions.cc
21 * @brief Exceptions thrown by libdcp.
24 #include "exceptions.h"
25 #include "compose.hpp"
30 FileError::FileError (string message, boost::filesystem::path filename, int number)
31 : StringError (String::compose ("%1 (%2) (error %3)", message, filename.string(), number))
32 , _filename (filename)
38 UnresolvedRefError::UnresolvedRefError (string id)
39 : StringError (String::compose ("Unresolved reference to asset id %1", id))
44 TimeFormatError::TimeFormatError (string bad_time)
45 : StringError (String::compose ("Bad time string %1", bad_time))
50 MissingAssetError::MissingAssetError (boost::filesystem::path path, AssetType type)
57 type_name = " for main picture";
60 type_name = " for main sound";
63 type_name = " for main subtitle";
69 _message = String::compose ("Missing asset %1%2", path.string(), type_name);
72 NotEncryptedError::NotEncryptedError (string const & what)
73 : StringError (String::compose ("%1 is not encrypted", what))