Add AsyncSocketExceptionType for early data rejection.
[folly.git] / folly / io / async / AsyncSocketException.h
index 85054d867ef192c7bd07253b405786769e996fc6..19aecd2f4d52a9255b17d451f1fddae9c21ed892 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,6 +16,8 @@
 
 #pragma once
 
+#include <stdexcept>
+
 #include <folly/Format.h>
 #include <folly/io/async/DelayedDestruction.h>
 
@@ -38,7 +40,8 @@ class AsyncSocketException : public std::runtime_error {
     SSL_ERROR = 12,
     COULD_NOT_BIND = 13,
     SASL_HANDSHAKE_TIMEOUT = 14,
-    NETWORK_ERROR = 15
+    NETWORK_ERROR = 15,
+    EARLY_DATA_REJECTED = 16,
   };
 
   AsyncSocketException(AsyncSocketExceptionType type,
@@ -96,6 +99,10 @@ class AsyncSocketException : public std::runtime_error {
         return "Could not bind";
       case SASL_HANDSHAKE_TIMEOUT:
         return "SASL handshake timeout";
+      case NETWORK_ERROR:
+        return "Network error";
+      case EARLY_DATA_REJECTED:
+        return "Early data rejected";
       default:
         return "(Invalid exception type)";
     }
@@ -120,4 +127,4 @@ class AsyncSocketException : public std::runtime_error {
   }
 };
 
-} // folly
+} // namespace folly