https://mooseframework.inl.gov
Loading...
Searching...
No Matches
CapabilityException.h
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#pragma once
11
12#include "StreamArguments.h"
13
14#include <exception>
15#include <string>
16#include <vector>
17
18namespace Moose
19{
23class CapabilityException : public std::runtime_error
24{
25public:
27
28 template <typename... Args>
29 static std::string stringify(Args &&... args)
30 {
31 std::ostringstream ss;
32 streamArguments(ss, args...);
33 return ss.str();
34 }
35
36 template <typename... Args>
37 explicit CapabilityException(Args &&... args) : std::runtime_error(stringify(args...))
38 {
39 }
40
42};
43
48{
49public:
50 UnknownCapabilitiesException(const std::vector<std::string> & unknown_capabilities);
51
53 const std::vector<std::string> unknown_capabilities;
54};
55}
void streamArguments(StreamType &)
Common execption to be thrown when interacting with capabilities.
static std::string stringify(Args &&... args)
CapabilityException(const CapabilityException &)=default
Exception thrown when capabilities are unknown.
const std::vector< std::string > unknown_capabilities
The capabilities that are unknown.
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...