X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=blobdiff_plain;f=folly%2FIPAddressException.h;h=d1830ba61737ea56cdb5b8b1fdbd25e4525bc29b;hp=1b5253ea4e90d6fd45c92f9b0bbd52548f1cefaf;hb=ee207f19892790e091082cc7c7ab8c5df0398061;hpb=c8f4d603e448cdd2749f2850ef70952932962fa1 diff --git a/folly/IPAddressException.h b/folly/IPAddressException.h index 1b5253ea..d1830ba6 100644 --- a/folly/IPAddressException.h +++ b/folly/IPAddressException.h @@ -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. @@ -24,6 +24,11 @@ namespace folly { +/** + * Error codes for non-throwing interface of IPAddress family of functions. + */ +enum class IPAddressFormatError { INVALID_IP, UNSUPPORTED_ADDR_FAMILY }; + /** * Exception for invalid IP addresses. */ @@ -37,8 +42,8 @@ class IPAddressFormatException : public std::exception { default; IPAddressFormatException& operator=(IPAddressFormatException&&) = default; - virtual ~IPAddressFormatException() noexcept {} - virtual const char *what(void) const noexcept { + ~IPAddressFormatException() noexcept override {} + const char* what() const noexcept override { return msg_.c_str(); } @@ -62,4 +67,4 @@ class InvalidAddressFamilyException : public IPAddressFormatException { default; }; -} // folly +} // namespace folly