diff options
author | Morph <39850852+Morph1984@users.noreply.github.com> | 2021-09-08 14:36:20 -0400 |
---|---|---|
committer | Morph <39850852+Morph1984@users.noreply.github.com> | 2021-09-11 17:19:14 -0400 |
commit | 290afc00d36bbdcdc67d66a4586fd2f188734ad3 (patch) | |
tree | d4f9a8eae42dd93ff1e7393ffea03b30faeab125 /src/common/error.h | |
parent | be4e1929033aff005472163164ab0ccc80d81c19 (diff) |
common: Move error handling to error.cpp/h
This allows us to avoid implicitly including <string> every time common_funcs.h is included.
Diffstat (limited to 'src/common/error.h')
-rw-r--r-- | src/common/error.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/common/error.h b/src/common/error.h new file mode 100644 index 0000000000..e084d4b0f2 --- /dev/null +++ b/src/common/error.h @@ -0,0 +1,21 @@ +// Copyright 2013 Dolphin Emulator Project / 2014 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include <string> + +namespace Common { + +// Generic function to get last error message. +// Call directly after the command or use the error num. +// This function might change the error code. +// Defined in error.cpp. +[[nodiscard]] std::string GetLastErrorMsg(); + +// Like GetLastErrorMsg(), but passing an explicit error code. +// Defined in error.cpp. +[[nodiscard]] std::string NativeErrorToString(int e); + +} // namespace Common |