Don't declare caught exceptions when not actually used
authorChristopher Dykes <cdykes@fb.com>
Fri, 16 Jun 2017 02:47:37 +0000 (19:47 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Fri, 16 Jun 2017 02:51:21 +0000 (19:51 -0700)
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

folly/experimental/logging/LogLevel.cpp
folly/experimental/logging/LogStream.cpp

index a60e024eb85bec2a1698baaf1f635de796becce4..03e13d33e0f5566ea690229784625023039800e8 100644 (file)
@@ -76,7 +76,7 @@ LogLevel stringToLogLevel(StringPiece name) {
   try {
     auto level = folly::to<uint32_t>(lowerName);
     return static_cast<LogLevel>(level);
-  } catch (const std::exception& ex) {
+  } catch (const std::exception&) {
     throw std::range_error("invalid logger name " + name.str());
   }
 }
index 3bf4acf677391329911bef91cd0bd6c18d12841e..f3ecbbe722ff5ee94bbeb2fefeaf16998ab4c1ed 100644 (file)
@@ -38,7 +38,7 @@ LogStreamBuffer::int_type LogStreamBuffer::overflow(int_type ch) {
       setp((&str_.front()) + currentSize + 1, (&str_.front()) + newSize);
       return ch;
     }
-  } catch (const std::exception& ex) {
+  } catch (const std::exception&) {
     // Return EOF to indicate that the operation failed.
     // In general the only exception we really expect to see here is
     // std::bad_alloc() from the str_.resize() call.