palimpsest v3.0.0
Loading...
Searching...
No Matches
KeyError.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// Copyright 2022 Stéphane Caron
3
4#pragma once
5
6#include <string>
7
9
11
13class KeyError : public PalimpsestError {
14 public:
22 KeyError(const std::string& key, const std::string& file, unsigned line,
23 const std::string& message)
25 file, line,
26 std::string("Key \"") + key + "\" not found. " + message),
27 key_(key) {}
28
30 ~KeyError() throw() {}
31
33 const std::string& key() const throw() { return key_; }
34
35 private:
37 std::string key_;
38};
39
40} // namespace palimpsest::exceptions
Requested dictionary key is not found.
Definition: KeyError.h:13
KeyError(const std::string &key, const std::string &file, unsigned line, const std::string &message)
Create a key error.
Definition: KeyError.h:22
~KeyError()
Empty destructor.
Definition: KeyError.h:30
const std::string & key() const
Key that was not found.
Definition: KeyError.h:33
Error with file and line references to the calling code.
Exceptions raised by the library.
Definition: KeyError.h:10