mirror of
https://github.com/autc04/Retro68.git
synced 2025-02-01 23:31:37 +00:00
Rez: report errors from $$read
This commit is contained in:
parent
3675b0e252
commit
e40a4c76a1
@ -189,7 +189,10 @@ std::string ReadExpr::evaluateString(ResourceCompiler *ctx)
|
||||
{
|
||||
std::string filename = arg->evaluateString(ctx);
|
||||
std::ifstream instream(filename);
|
||||
// ### TODO: check error
|
||||
if(!instream)
|
||||
{
|
||||
ctx->problem(Diagnostic(Diagnostic::Severity::error, "could not $$read file " + filename, location));
|
||||
}
|
||||
return std::string(std::istreambuf_iterator<char>(instream.rdbuf()),
|
||||
std::istreambuf_iterator<char>());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user