If a .drv cannot be parsed, show its path
Otherwise you just get ‘expected string `Derive(['’ which isn't very helpful.
This commit is contained in:
+1
-1
@@ -1041,7 +1041,7 @@ void expect(std::istream & str, const string & s)
|
||||
char s2[s.size()];
|
||||
str.read(s2, s.size());
|
||||
if (string(s2, s.size()) != s)
|
||||
throw Error(format("expected string `%1%'") % s);
|
||||
throw FormatError(format("expected string `%1%'") % s);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -326,6 +326,8 @@ bool hasSuffix(const string & s, const string & suffix);
|
||||
/* Read string `s' from stream `str'. */
|
||||
void expect(std::istream & str, const string & s);
|
||||
|
||||
MakeError(FormatError, Error)
|
||||
|
||||
|
||||
/* Read a C-style string from stream `str'. */
|
||||
string parseString(std::istream & str);
|
||||
|
||||
Reference in New Issue
Block a user