diff options
| author | jacqueline <me@jacqueline.id.au> | 2023-07-25 17:42:36 +1000 |
|---|---|---|
| committer | jacqueline <me@jacqueline.id.au> | 2023-07-25 17:43:12 +1000 |
| commit | 80d7df910987db5201402fe987124f29f09344f3 (patch) | |
| tree | 7e8c1e04ab40026087343efee95a771c7839b32f /src/codecs/include/codec.hpp | |
| parent | 7b72e5479ee6d11f76c49f7463ba0e7f4e5165c5 (diff) | |
| download | tangara-fw-80d7df910987db5201402fe987124f29f09344f3.tar.gz | |
fuck off
Diffstat (limited to 'src/codecs/include/codec.hpp')
| -rw-r--r-- | src/codecs/include/codec.hpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/codecs/include/codec.hpp b/src/codecs/include/codec.hpp index 299b16e4..e8be8f0a 100644 --- a/src/codecs/include/codec.hpp +++ b/src/codecs/include/codec.hpp @@ -40,6 +40,18 @@ class ICodec { kInternalError, }; + static auto ErrorString(Error err) -> std::string { + switch (err) { + case Error::kOutOfInput: + return "out of input"; + case Error::kMalformedData: + return "malformed data"; + case Error::kInternalError: + return "internal error"; + } + return "uhh"; + } + /* * Alias for more readable return types. All codec methods, success or * failure, should also return the number of bytes they consumed. |
