diff options
author | Gunnar Mills <gmills@us.ibm.com> | 2020-11-13 18:35:30 +0300 |
---|---|---|
committer | Gunnar Mills <gmills@us.ibm.com> | 2020-11-13 19:17:17 +0300 |
commit | 929d4b57f10bc4200e16b71fbcf32521d8cc23c1 (patch) | |
tree | 3540a2df01041e22b82e045dcfe8089ff21d7b97 /COMMON_ERRORS.md | |
parent | 3a17e02873fdf53898a2cfce894dcb36223d76d4 (diff) | |
download | bmcweb-929d4b57f10bc4200e16b71fbcf32521d8cc23c1.tar.xz |
Common Errors: Fix list formatting
Pretty sure the author wanted these on separate lines so do that.
Makes the list a lot easier to scan.
Could have done this multiple ways but went with bullets.
Fixed an escape.
Tested: https://jbt.github.io/markdown-editor/
Change-Id: Ia0a0e5a2023f7eebda1ebf2d4d1d6528429cce8c
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
Diffstat (limited to 'COMMON_ERRORS.md')
-rw-r--r-- | COMMON_ERRORS.md | 63 |
1 files changed, 32 insertions, 31 deletions
diff --git a/COMMON_ERRORS.md b/COMMON_ERRORS.md index c68c86cdfe..0157165bbe 100644 --- a/COMMON_ERRORS.md +++ b/COMMON_ERRORS.md @@ -60,23 +60,24 @@ int myBadMethod(nlohmann::json& j){ This method throws, and bad inputs will not be handled Commonly used methods that fall into this pattern: -std::variant::get -std::vector::at -std::map::at -std::set::at -std::<generic container type>::at -nlohmann::json::operator!= -nlohmann::json::operator+= -nlohmann::json::at -nlohmann::json::get -nlohmann::json::get\_ref -nlohmann::json::get\_to -std::filesystem::create\_directory -std::filesystem::rename -std::filesystem::file\_size -std::stoi -std::stol -std::stoll + +- std::variant::get +- std::vector::at +- std::map::at +- std::set::at +- std::\<generic container type\>::at +- nlohmann::json::operator!= +- nlohmann::json::operator+= +- nlohmann::json::at +- nlohmann::json::get +- nlohmann::json::get\_ref +- nlohmann::json::get\_to +- std::filesystem::create\_directory +- std::filesystem::rename +- std::filesystem::file\_size +- std::stoi +- std::stol +- std::stoll #### special/strange case: @@ -91,11 +92,11 @@ throws on failure, and a method that accepts and returns an error code. This is not a complete list, but users should verify in the boost docs when calling into asio methods, and prefer the one that returns an error code instead of throwing. -boost::asio::ip::tcp::acceptor::bind(); -boost::asio::ip::tcp::acceptor::cancel(); -boost::asio::ip::tcp::acceptor::close(); -boost::asio::ip::tcp::acceptor::listen(); -boost::asio::ip::address::make\_address(); +- boost::asio::ip::tcp::acceptor::bind(); +- boost::asio::ip::tcp::acceptor::cancel(); +- boost::asio::ip::tcp::acceptor::close(); +- boost::asio::ip::tcp::acceptor::listen(); +- boost::asio::ip::address::make\_address(); ### Blocking functions @@ -103,15 +104,15 @@ bmcweb uses a single reactor for all operations. Blocking that reactor for any amount of time causes all other operations to stop. The common blocking functions that tend to be called incorrectly are: -sleep() -boost::asio::ip::tcp::socket::read() -boost::asio::ip::tcp::socket::read\_some() -boost::asio::ip::tcp::socket::write() -boost::asio::ip::tcp::socket::write\_some() -boost::asio::ip::tcp::socket::connect() -boost::asio::ip::tcp::socket::send() -boost::asio::ip::tcp::socket::wait() -boost::asio::steady\_timer::wait() +- sleep() +- boost::asio::ip::tcp::socket::read() +- boost::asio::ip::tcp::socket::read\_some() +- boost::asio::ip::tcp::socket::write() +- boost::asio::ip::tcp::socket::write\_some() +- boost::asio::ip::tcp::socket::connect() +- boost::asio::ip::tcp::socket::send() +- boost::asio::ip::tcp::socket::wait() +- boost::asio::steady\_timer::wait() Note: an exception is made for filesystem/disk IO read and write. This is mostly due to not having great abstractions for it that mate well with the async |