Skip to content

Commit

Permalink
Refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
DirtyHairy committed Jul 7, 2024
1 parent 7386424 commit c581fd7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/emucore/CartELF.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
}

Expand Down
6 changes: 3 additions & 3 deletions src/emucore/elf/ElfParser.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c581fd7

Please sign in to comment.