Skip to content

Commit 8aba76e

Browse files
authored
Merge pull request #76 from neogeek/hotfix/added-missing-default-case
[hotfix] Added missing default case to enum ToString method.
2 parents 735ff76 + db5bb47 commit 8aba76e

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

include/RhythmGameUtilities/Enums/Difficulty.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ std::string ToString(Difficulty difficulty)
3434
return "Hard";
3535
case Expert:
3636
return "Expert";
37+
default:
38+
throw std::invalid_argument("Unknown Difficulty");
3739
}
3840
}
3941

include/RhythmGameUtilities/Enums/NamedSection.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ std::string ToString(NamedSection namedSection)
2727
return "SyncTrack";
2828
case Events:
2929
return "Events";
30+
default:
31+
throw std::invalid_argument("Unknown NamedSection");
3032
}
3133
}
3234

include/RhythmGameUtilities/Enums/TypeCode.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ std::string ToString(TypeCode typeCode)
3434
return "N";
3535
case EventMarker:
3636
return "E";
37+
default:
38+
throw std::invalid_argument("Unknown TypeCode");
3739
}
3840
}
3941

0 commit comments

Comments
 (0)