3
0
Fork 0
forked from suyu/suyu
suyu/src/core
comex 2910aa77b2 [network] Error handling reform
`network.cpp` has several error paths which either:
- report "Unhandled host socket error=n" and return `SUCCESS`, or
- switch on a few possible errors, log them, and translate them to
  Errno; the same switch statement is copied and pasted in multiple
  places in the code

Convert these paths to use a helper function `GetAndLogLastError`, which
is roughly the equivalent of one of the switch statements, but:
- handling more cases (both ones that were already in `Errno`, and a few
  more I added), and
- using OS functions to convert the error to a string when logging, so
  it'll describe the error even if it's not one of the ones in the
  switch statement.
  - To handle this, refactor the logic in `GetLastErrorMsg` to expose a
    new function `NativeErrorToString` which takes the error number
    explicitly as an argument.  And improve the Windows version a bit.

Also, add a test which exercises two random error paths.
2021-02-28 17:25:31 -05:00
..
arm arm_dynarmic_32: Print out CPSR.T on exception 2021-02-01 18:35:33 +00:00
crypto key_manager: Create the keys directory if it does not exist 2021-02-04 06:05:50 -05:00
file_sys vfs_real: When moving files or directories, don't assume file opening will succeed 2021-01-23 16:19:29 -05:00
frontend hid: Implement GC controller 2021-02-07 22:59:46 -06:00
hle Merge pull request #6007 from bunnei/ldn-error 2021-02-28 13:34:20 -08:00
loader hle: kernel: Migrate PageHeap/PageTable to KPageHeap/KPageTable. 2021-02-18 16:16:25 -08:00
memory hle: kernel: Migrate PageHeap/PageTable to KPageHeap/KPageTable. 2021-02-18 16:16:25 -08:00
network [network] Error handling reform 2021-02-28 17:25:31 -05:00
tools
CMakeLists.txt hle: kernel: Migrate PageHeap/PageTable to KPageHeap/KPageTable. 2021-02-18 16:16:25 -08:00
constants.cpp
constants.h
core.cpp kernel: Fix resource release exception on exit 2021-02-20 20:51:11 -05:00
core.h lm: Recode LM service 2021-01-20 18:25:15 +11:00
core_timing.cpp core: hle: Add missing calls to MicroProfileOnThreadExit. 2021-01-11 14:23:16 -08:00
core_timing.h
core_timing_util.h core: core_timing_util: Optimize core timing math. 2021-02-15 14:54:06 -08:00
cpu_manager.cpp core: cpu_manager: Remove unused variable. 2021-01-28 21:42:26 -08:00
cpu_manager.h
device_memory.cpp
device_memory.h
hardware_interrupt_manager.cpp
hardware_interrupt_manager.h
hardware_properties.h kernel: k_light_lock: Simplify EmuThreadHandle implementation. 2021-01-28 21:42:26 -08:00
memory.cpp hle: kernel: Migrate PageHeap/PageTable to KPageHeap/KPageTable. 2021-02-18 16:16:25 -08:00
memory.h core: memory: Add templated GetPointer methods. 2021-02-18 16:16:24 -08:00
perf_stats.cpp
perf_stats.h
reporter.cpp hle: kernel: Migrate PageHeap/PageTable to KPageHeap/KPageTable. 2021-02-18 16:16:25 -08:00
reporter.h lm: Recode LM service 2021-01-20 18:25:15 +11:00
settings.cpp settings: Log the cache, config, and mod load directories 2021-02-02 04:01:05 -05:00
settings.h Add mouse panning 2021-02-07 20:31:58 -06:00
telemetry_session.cpp
telemetry_session.h