Skip to content

Commit

Permalink
Updated example code
Browse files Browse the repository at this point in the history
  • Loading branch information
Alkenso authored Jul 26, 2019
1 parent 2c79b9c commit 7940272
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions include/asenum/asenum.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
};
//===== USAGE =====
void LogSetting(const AnyError& event)
void LogError(const AnyError& event)
{
event.doSwitch()
.asCase<ErrorCode::Unknown>([] (const std::string& value) {
Expand Down Expand Up @@ -111,15 +111,15 @@
int main()
{
// ===== CREATION =====
LogSetting(AnyError::createUnknown("test.api.com"));
LogSetting(AnyError::createSuccess());
LogSetting(AnyError::createTimeout(std::chrono::seconds(1)));
LogError(AnyError::createUnknown("test.api.com"));
LogError(AnyError::createSuccess());
LogError(AnyError::createTimeout(std::chrono::seconds(1)));
// === vs ===
LogSetting(AnyError::create<ErrorCode::Unknown>("test.api.com"));
LogSetting(AnyError::create<ErrorCode::Success>());
LogSetting(AnyError::create<ErrorCode::Timeout>(std::chrono::seconds(1)));
LogError(AnyError::create<ErrorCode::Unknown>("test.api.com"));
LogError(AnyError::create<ErrorCode::Success>());
LogError(AnyError::create<ErrorCode::Timeout>(std::chrono::seconds(1)));
return 0;
}
Expand Down

0 comments on commit 7940272

Please sign in to comment.