mCRL2
Loading...
Searching...
No Matches
exception.h
Go to the documentation of this file.
1// Author(s): Jeroen van der Wulp
2// Copyright: see the accompanying file COPYING or copy at
3// https://github.com/mCRL2org/mCRL2/blob/master/COPYING
4//
5// Distributed under the Boost Software License, Version 1.0.
6// (See accompanying file LICENSE_1_0.txt or copy at
7// http://www.boost.org/LICENSE_1_0.txt)
8//
11
12#ifndef MCRL2_UTILITIES_EXCEPTION_H
13#define MCRL2_UTILITIES_EXCEPTION_H
14
15#include <cassert>
16#include <iostream>
17#include <sstream>
18#include <stdexcept>
19
20namespace mcrl2
21{
22
26class runtime_error : public std::runtime_error
27{
28public:
31 runtime_error(const std::string& message) : std::runtime_error(message)
32 {}
33};
34
39{
40private:
41 std::string m_msg;
42
44 static std::string format(const std::string& name, const std::string& message)
45 {
46 std::stringstream s;
47 s << name << ": " << message << "\n"
48 << "Try '" << name << " --help' for more information.";
49 return s.str();
50 }
51
52public:
53 command_line_error(const std::string& name, const std::string& message) throw()
54 : runtime_error(format(name, message))
55 {}
56
57 virtual ~command_line_error() throw() {}
58};
59
60} // namespace mcrl2
61
62#endif
Exception class for errors raised by the command-line parser.
Definition exception.h:39
virtual ~command_line_error()
Definition exception.h:57
static std::string format(const std::string &name, const std::string &message)
Definition exception.h:44
command_line_error(const std::string &name, const std::string &message)
Definition exception.h:53
Standard exception class for reporting runtime errors.
Definition exception.h:27
runtime_error(const std::string &message)
Constructor.
Definition exception.h:31
A class that takes a linear process specification and checks all tau-summands of that LPS for conflue...
Definition indexed_set.h:72
STL namespace.