[wpilibc] Errors: Use fmtlib

This commit is contained in:
Peter Johnson
2021-05-23 19:33:33 -07:00
parent 87603e400d
commit 831c10bdfc
55 changed files with 551 additions and 533 deletions

View File

@@ -86,7 +86,7 @@ nt::NetworkTableEntry SmartDashboard::GetEntry(wpi::StringRef key) {
void SmartDashboard::PutData(wpi::StringRef key, Sendable* data) {
if (!data) {
throw FRC_MakeError(err::NullParameter, "value");
throw FRC_MakeError(err::NullParameter, "{}", "value");
}
auto& inst = Singleton::GetInstance();
std::scoped_lock lock(inst.tablesToDataMutex);
@@ -103,7 +103,7 @@ void SmartDashboard::PutData(wpi::StringRef key, Sendable* data) {
void SmartDashboard::PutData(Sendable* value) {
if (!value) {
throw FRC_MakeError(err::NullParameter, "value");
throw FRC_MakeError(err::NullParameter, "{}", "value");
}
auto name = SendableRegistry::GetInstance().GetName(value);
if (!name.empty()) {
@@ -116,7 +116,7 @@ Sendable* SmartDashboard::GetData(wpi::StringRef key) {
std::scoped_lock lock(inst.tablesToDataMutex);
auto it = inst.tablesToData.find(key);
if (it == inst.tablesToData.end()) {
throw FRC_MakeError(err::SmartDashboardMissingKey, key);
throw FRC_MakeError(err::SmartDashboardMissingKey, "{}", key);
}
return SendableRegistry::GetInstance().GetSendable(it->getValue());
}