mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-19 04:52:13 +02:00
Updated other exception to also be runtime_error type instead.
This commit is contained in:
@@ -616,7 +616,7 @@ void doSomethingWithAFile(const char* filename)
|
||||
{
|
||||
FILE* fh = fopen(filename, "r"); // Open the file in read mode
|
||||
if (fh == nullptr)
|
||||
throw std::exception();
|
||||
throw std::runtime_error("Could not open the file.");
|
||||
|
||||
try {
|
||||
doSomethingWithTheFile(fh);
|
||||
|
Reference in New Issue
Block a user