2 Copyright (C) 2012-2014 Carl Hetherington <cth@carlh.net>
4 This file is part of DCP-o-matic.
6 DCP-o-matic is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 DCP-o-matic is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
21 #include "exceptions.h"
22 #include "compose.hpp"
27 using std::runtime_error;
29 /** @param f File that we were trying to open */
30 OpenFileError::OpenFileError (boost::filesystem::path f)
31 : FileError (String::compose (_("could not open file %1"), f.string()), f)
36 /** @param f File that we were trying to create */
37 CreateFileError::CreateFileError (boost::filesystem::path f)
38 : FileError (String::compose (_("could not create file %1"), f.string()), f)
43 ReadFileError::ReadFileError (boost::filesystem::path f, int e)
44 : FileError (String::compose (_("could not read from file %1 (%2)"), f.string(), strerror (e)), f)
49 WriteFileError::WriteFileError (boost::filesystem::path f, int e)
50 : FileError (String::compose (_("could not write to file %1 (%2)"), f.string(), strerror (e)), f)
55 MissingSettingError::MissingSettingError (string s)
56 : SettingError (s, String::compose (_("missing required setting %1"), s))
61 PixelFormatError::PixelFormatError (string o, AVPixelFormat f)
62 : runtime_error (String::compose (_("Cannot handle pixel format %1 during %2"), f, o))
67 TextSubtitleError::TextSubtitleError (string saw, string expecting, boost::filesystem::path f)
68 : FileError (String::compose (_("Error in subtitle file: saw %1 while expecting %2"), saw.empty() ? "[nothing]" : saw, expecting), f)
73 InvalidSignerError::InvalidSignerError ()
74 : runtime_error (_("The certificate chain for signing is invalid"))
79 ProgrammingError::ProgrammingError (string file, int line)
80 : runtime_error (String::compose (_("Programming error at %1:%2"), file, line))