source: trunk/lib/Exception.h @ 745

Last change on this file since 745 was 705, checked in by Peter Johansson, 13 years ago

importing classes for commandline parsing from yat. This fixes #349 and #265

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 1.7 KB
Line 
1#ifndef _theplu_svndigest_exception_
2#define _theplu_svndigest_exception_
3
4// $Id: Exception.h 705 2008-11-25 23:33:26Z peter $
5
6/*
7  Copyright (C) 2008 Peter Johansson
8
9  This file is part of svndigest, http://trac.thep.lu.se/svndigest
10
11  svndigest is free software; you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation; either version 2 of the License, or
14  (at your option) any later version.
15
16  svndigest is distributed in the hope that it will be useful, but
17  WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  General Public License for more details.
20
21  You should have received a copy of the GNU General Public License
22  along with this program; if not, write to the Free Software
23  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
24  02111-1307, USA.
25*/
26
27#include <stdexcept>
28#include <string>
29
30namespace theplu {
31namespace svndigest {
32
33  /**
34     \brief Class used for error reported from Commandline or Option.
35   */
36  class cmd_error : public std::runtime_error
37  {
38  public:
39    /**
40       \brief Constructor
41
42       \param message message to be displayed using function what().
43     */
44    inline cmd_error(std::string message)
45      : std::runtime_error(message) {}
46  };
47
48
49  /**
50     \brief Class to report errors associated with IO operations.
51
52     IO_error is used in the same way as C++ standard library
53     exceptions.
54  */
55  class IO_error : public std::runtime_error
56  {
57  public:
58    /**
59       \brief Constructor to create an exception with a message.
60    */
61    inline IO_error(std::string message) throw()
62      : std::runtime_error("IO_error: " + message) {}
63  };
64
65}} // of namespace svndigest and theplu
66
67#endif
Note: See TracBrowser for help on using the repository browser.