Files
allwpilib/include/tables/TableKeyNotDefinedException.h
Peter Johnson 76ee093e92 Add exception-generating C++ functions, but mark as deprecated.
These are good to have for backwards compatibility, but discouraged for new
development (default-taking functions should be used instead).  The reason
is that the exceptions must be explicitly handled and may initially work but
then fail at an inopportune moment.

Mark the similar Java functions as deprecated as well for the same reason.

Update all the docs for consistency.

Mark overridden functions as such in both C++ and Java.

Make IsPersistent and GetFlags const in C++.
2015-12-06 22:39:38 -08:00

31 lines
1.0 KiB
C++

/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2015. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
/*----------------------------------------------------------------------------*/
#ifndef TABLEKEYNOTDEFINEDEXCEPTION_H_
#define TABLEKEYNOTDEFINEDEXCEPTION_H_
#include <exception>
#include "llvm/StringRef.h"
/**
* An exception thrown when the lookup a a key-value fails in a {@link ITable}
*/
class TableKeyNotDefinedException : public std::exception {
public:
/**
* @param key the key that was not defined in the table
*/
TableKeyNotDefinedException(llvm::StringRef key);
~TableKeyNotDefinedException() noexcept;
const char* what();
private:
std::string msg;
};
#endif // TABLEKEYNOTDEFINEDEXCEPTION_H_