mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 20:51:16 +00:00
Centralized the error messages to one location.
This commit is contained in:
@@ -35,7 +35,7 @@ namespace YAML
|
||||
if(params.onDocIndicator == BREAK)
|
||||
break;
|
||||
else if(params.onDocIndicator == THROW)
|
||||
throw ParserException(INPUT.line, INPUT.column, "illegal document indicator in scalar");
|
||||
throw ParserException(INPUT.line, INPUT.column, ErrorMsg::DOC_IN_SCALAR);
|
||||
}
|
||||
|
||||
foundNonEmptyLine = true;
|
||||
@@ -61,7 +61,7 @@ namespace YAML
|
||||
// eof? if we're looking to eat something, then we throw
|
||||
if(INPUT.peek() == EOF) {
|
||||
if(params.eatEnd)
|
||||
throw ParserException(INPUT.line, INPUT.column, "illegal EOF in scalar");
|
||||
throw ParserException(INPUT.line, INPUT.column, ErrorMsg::EOF_IN_SCALAR);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace YAML
|
||||
while(Exp::Blank.Matches(INPUT)) {
|
||||
// we check for tabs that masquerade as indentation
|
||||
if(INPUT.peek() == '\t'&& INPUT.column < params.indent && params.onTabInIndentation == THROW)
|
||||
throw ParserException(INPUT.line, INPUT.column, "illegal tab when looking for indentation");
|
||||
throw ParserException(INPUT.line, INPUT.column, ErrorMsg::TAB_IN_INDENTATION);
|
||||
|
||||
if(!params.eatLeadingWhitespace)
|
||||
break;
|
||||
|
Reference in New Issue
Block a user