| 1 | // Copyright (C) Microsoft Corporation. All rights reserved. |
| 2 | #pragma once |
| 3 | |
| 4 | #include "RuntimeErrorWithSourceLocation.h" |
| 5 | #include "NetlinkMessage.h" |
| 6 | |
| 7 | class NetlinkTransactionError : public RuntimeErrorWithSourceLocation |
| 8 | { |
| 9 | public: |
| 10 | NetlinkTransactionError( |
| 11 | const std::vector<char>& request, |
| 12 | const std::vector<NetlinkResponse>& responses, |
| 13 | const std::exception& inner, |
| 14 | const std::source_location& source = std::source_location::current()); |
| 15 | |
| 16 | std::optional<int> Error() const; |
| 17 | |
| 18 | private: |
| 19 | static std::string BuildMessage(const std::vector<char>& request, const std::vector<NetlinkResponse>& responses, const std::exception& inner); |
| 20 | |
| 21 | std::optional<int> m_error; |
| 22 | }; |