1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-12-13 20:13:06 +00:00

Log file stream errors

This commit is contained in:
elsid 2025-12-03 23:18:48 +01:00
parent c7b0f99079
commit cef1bb1219
No known key found for this signature in database
GPG key ID: B845CB9FEE18AB40

View file

@ -9,6 +9,7 @@
#include <regex> #include <regex>
#include <set> #include <set>
#include <sstream> #include <sstream>
#include <system_error>
#include <unordered_map> #include <unordered_map>
#include <osg/Program> #include <osg/Program>
@ -169,7 +170,8 @@ namespace Shader
includeFstream.open(includePath); includeFstream.open(includePath);
if (includeFstream.fail()) if (includeFstream.fail())
{ {
Log(Debug::Error) << "Shader " << fileName << " error: Failed to open include " << includePath; Log(Debug::Error) << "Shader " << fileName << " error: Failed to open include " << includePath << ": "
<< std::generic_category().message(errno);
return false; return false;
} }
int includedFileNumber = fileNumber++; int includedFileNumber = fileNumber++;
@ -469,7 +471,8 @@ namespace Shader
stream.open(path); stream.open(path);
if (stream.fail()) if (stream.fail())
{ {
Log(Debug::Error) << "Failed to open " << Files::pathToUnicodeString(path); Log(Debug::Error)
<< "Failed to open " << path << ": " << std::generic_category().message(errno);
continue; continue;
} }
std::stringstream buffer; std::stringstream buffer;
@ -523,7 +526,7 @@ namespace Shader
stream.open(path); stream.open(path);
if (stream.fail()) if (stream.fail())
{ {
Log(Debug::Error) << "Failed to open " << path; Log(Debug::Error) << "Failed to open shader " << path << ": " << std::generic_category().message(errno);
return nullptr; return nullptr;
} }
std::stringstream buffer; std::stringstream buffer;