From 01f53cec6d84daea068842764e74470b5597c882 Mon Sep 17 00:00:00 2001 From: Christian Speckner Date: Sun, 7 Jul 2024 09:34:17 +0200 Subject: [PATCH] Refactoring. --- src/emucore/CartELF.cxx | 2 +- src/emucore/elf/ElfParser.hxx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/emucore/CartELF.cxx b/src/emucore/CartELF.cxx index 6e757125a..b3b86f92d 100644 --- a/src/emucore/CartELF.cxx +++ b/src/emucore/CartELF.cxx @@ -101,7 +101,7 @@ CartridgeELF::CartridgeELF(const ByteBuffer& image, size_t size, string_view md5 { try { elfParser.parse(image.get(), size); - } catch (ElfParser::EInvalidElf& e) { + } catch (ElfParser::ElfParseError& e) { throw runtime_error("failed to initialize ELF: " + string(e.what())); } diff --git a/src/emucore/elf/ElfParser.hxx b/src/emucore/elf/ElfParser.hxx index f757ac77b..6f3dbd224 100644 --- a/src/emucore/elf/ElfParser.hxx +++ b/src/emucore/elf/ElfParser.hxx @@ -24,18 +24,18 @@ class ElfParser { public: - class EInvalidElf : public std::exception { + class ElfParseError : public std::exception { friend ElfParser; public: const char* what() const noexcept override { return myReason.c_str(); } [[noreturn]] static void raise(string_view message) { - throw EInvalidElf(message); + throw ElfParseError(message); } private: - explicit EInvalidElf(string_view reason) : myReason(reason) {} + explicit ElfParseError(string_view reason) : myReason(reason) {} private: const string myReason;