Commit ab9a4d71 authored by Christopher Dykes's avatar Christopher Dykes Committed by Facebook Github Bot

Don't declare caught exceptions when not actually used

Summary: There are a couple of places where the caught exception was being given a name that was never used, generating a warning under MSVC.

Reviewed By: simpkins

Differential Revision: D5260131

fbshipit-source-id: f82c6bd1266f6a4c916594ec3ac94edc9a2e48fe
parent cd02eca6
...@@ -76,7 +76,7 @@ LogLevel stringToLogLevel(StringPiece name) { ...@@ -76,7 +76,7 @@ LogLevel stringToLogLevel(StringPiece name) {
try { try {
auto level = folly::to<uint32_t>(lowerName); auto level = folly::to<uint32_t>(lowerName);
return static_cast<LogLevel>(level); return static_cast<LogLevel>(level);
} catch (const std::exception& ex) { } catch (const std::exception&) {
throw std::range_error("invalid logger name " + name.str()); throw std::range_error("invalid logger name " + name.str());
} }
} }
......
...@@ -38,7 +38,7 @@ LogStreamBuffer::int_type LogStreamBuffer::overflow(int_type ch) { ...@@ -38,7 +38,7 @@ LogStreamBuffer::int_type LogStreamBuffer::overflow(int_type ch) {
setp((&str_.front()) + currentSize + 1, (&str_.front()) + newSize); setp((&str_.front()) + currentSize + 1, (&str_.front()) + newSize);
return ch; return ch;
} }
} catch (const std::exception& ex) { } catch (const std::exception&) {
// Return EOF to indicate that the operation failed. // Return EOF to indicate that the operation failed.
// In general the only exception we really expect to see here is // In general the only exception we really expect to see here is
// std::bad_alloc() from the str_.resize() call. // std::bad_alloc() from the str_.resize() call.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment