Skip to content

Commit

Permalink
Clean up exception usage
Browse files Browse the repository at this point in the history
  • Loading branch information
msoucy committed Apr 22, 2017
1 parent ed6aa9d commit 1707188
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions import/dproto/parse.d
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ ProtoPackage ParseProtoSchema(const string name_, string data_)
switch(label) {
case "syntax": {
static if(is(Context==ProtoPackage)) {
unexpected(context.syntax == null, "too many syntax statements");
unexpected(context.syntax == null, "Too many syntax statements");
unexpected(readChar() == '=', "Expected '=' after 'syntax'");
unexpected(peekChar() == '"', `Expected opening quote '"' after 'syntax ='`);
context.syntax = readQuotedString();
Expand Down Expand Up @@ -476,7 +476,7 @@ ProtoPackage ParseProtoSchema(const string name_, string data_)
}
else
{
throw new DProtoReservedWordException(name);
throw new DProtoReservedWordException("Reserved word: "~name);
}
}
return name;
Expand Down Expand Up @@ -612,9 +612,7 @@ ProtoPackage ParseProtoSchema(const string name_, string data_)
{
if (!value)
{
throw new DProtoSyntaxException(
"Syntax error in %s at %d:%d: %s".format(fileName, line + 1,
(pos - lineStart + 1), message));
throw new DProtoSyntaxException(message, fileName, line + 1);
}
}

Expand Down

0 comments on commit 1707188

Please sign in to comment.