| 6 | |
| 7 | namespace orbis { |
| 8 | static orbis::ErrorCode toErrorCode(std::errc errc) { |
| 9 | if (errc == std::errc{}) { |
| 10 | return {}; |
| 11 | } |
| 12 | |
| 13 | switch (errc) { |
| 14 | case std::errc::address_family_not_supported: |
| 15 | return orbis::ErrorCode::AFNOSUPPORT; |
| 16 | case std::errc::address_in_use: |
| 17 | return orbis::ErrorCode::ADDRINUSE; |
| 18 | case std::errc::address_not_available: |
| 19 | return orbis::ErrorCode::ADDRNOTAVAIL; |
| 20 | case std::errc::already_connected: |
| 21 | return orbis::ErrorCode::ISCONN; |
| 22 | case std::errc::argument_out_of_domain: |
| 23 | return orbis::ErrorCode::DOM; |
| 24 | case std::errc::bad_address: |
| 25 | return orbis::ErrorCode::FAULT; |
| 26 | case std::errc::bad_file_descriptor: |
| 27 | return orbis::ErrorCode::BADF; |
| 28 | case std::errc::bad_message: |
| 29 | return orbis::ErrorCode::BADMSG; |
| 30 | case std::errc::broken_pipe: |
| 31 | return orbis::ErrorCode::PIPE; |
| 32 | case std::errc::connection_aborted: |
| 33 | return orbis::ErrorCode::CONNABORTED; |
| 34 | case std::errc::connection_already_in_progress: |
| 35 | return orbis::ErrorCode::ALREADY; |
| 36 | case std::errc::connection_refused: |
| 37 | return orbis::ErrorCode::CONNREFUSED; |
| 38 | case std::errc::connection_reset: |
| 39 | return orbis::ErrorCode::CONNRESET; |
| 40 | case std::errc::cross_device_link: |
| 41 | return orbis::ErrorCode::XDEV; |
| 42 | case std::errc::destination_address_required: |
| 43 | return orbis::ErrorCode::DESTADDRREQ; |
| 44 | case std::errc::device_or_resource_busy: |
| 45 | return orbis::ErrorCode::BUSY; |
| 46 | case std::errc::directory_not_empty: |
| 47 | return orbis::ErrorCode::NOTEMPTY; |
| 48 | case std::errc::executable_format_error: |
| 49 | return orbis::ErrorCode::NOEXEC; |
| 50 | case std::errc::file_exists: |
| 51 | return orbis::ErrorCode::EXIST; |
| 52 | case std::errc::file_too_large: |
| 53 | return orbis::ErrorCode::FBIG; |
| 54 | case std::errc::filename_too_long: |
| 55 | return orbis::ErrorCode::NAMETOOLONG; |
| 56 | case std::errc::function_not_supported: |
| 57 | return orbis::ErrorCode::NOSYS; |
| 58 | case std::errc::host_unreachable: |
| 59 | return orbis::ErrorCode::HOSTUNREACH; |
| 60 | case std::errc::identifier_removed: |
| 61 | return orbis::ErrorCode::IDRM; |
| 62 | case std::errc::illegal_byte_sequence: |
| 63 | return orbis::ErrorCode::ILSEQ; |
| 64 | case std::errc::inappropriate_io_control_operation: |
| 65 | return orbis::ErrorCode::NOTTY; |
no test coverage detected