Skip to content
Snippets Groups Projects
Unverified Commit 4879048c authored by psychocrypt's avatar psychocrypt Committed by GitHub
Browse files

Merge pull request #1262 from fireice-uk/topic-backend-errors

Add filename to backend errors
parents a885f60d 594c987e
No related branches found
No related tags found
No related merge requests found
......@@ -234,15 +234,15 @@ bool jconf::parse_config(const char* sFilename)
if(prv->jsonDoc.HasParseError())
{
printer::inst()->print_msg(L0, "JSON config parse error(offset %llu): %s",
int_port(prv->jsonDoc.GetErrorOffset()), GetParseError_En(prv->jsonDoc.GetParseError()));
printer::inst()->print_msg(L0, "JSON config parse error in '%s' (offset %llu): %s",
sFilename, int_port(prv->jsonDoc.GetErrorOffset()), GetParseError_En(prv->jsonDoc.GetParseError()));
return false;
}
if(!prv->jsonDoc.IsObject())
{ //This should never happen as we created the root ourselves
printer::inst()->print_msg(L0, "Invalid config file. No root?\n");
printer::inst()->print_msg(L0, "Invalid config file '%s'. No root?", sFilename);
return false;
}
......@@ -258,13 +258,13 @@ bool jconf::parse_config(const char* sFilename)
if(prv->configValues[i] == nullptr)
{
printer::inst()->print_msg(L0, "Invalid config file. Missing value \"%s\".", oConfigValues[i].sName);
printer::inst()->print_msg(L0, "Invalid config file '%s'. Missing value \"%s\".", sFilename, oConfigValues[i].sName);
return false;
}
if(!checkType(prv->configValues[i]->GetType(), oConfigValues[i].iType))
{
printer::inst()->print_msg(L0, "Invalid config file. Value \"%s\" has unexpected type.", oConfigValues[i].sName);
printer::inst()->print_msg(L0, "Invalid config file '%s'. Value \"%s\" has unexpected type.", sFilename, oConfigValues[i].sName);
return false;
}
}
......
......@@ -211,14 +211,14 @@ bool jconf::parse_config(const char* sFilename)
if(prv->jsonDoc.HasParseError())
{
printer::inst()->print_msg(L0, "JSON config parse error(offset %llu): %s",
int_port(prv->jsonDoc.GetErrorOffset()), GetParseError_En(prv->jsonDoc.GetParseError()));
printer::inst()->print_msg(L0, "JSON config parse error in '%s' (offset %llu): %s",
sFilename, int_port(prv->jsonDoc.GetErrorOffset()), GetParseError_En(prv->jsonDoc.GetParseError()));
return false;
}
if(!prv->jsonDoc.IsObject())
{ //This should never happen as we created the root ourselves
printer::inst()->print_msg(L0, "Invalid config file. No root?\n");
printer::inst()->print_msg(L0, "Invalid config file '%s'. No root?", sFilename);
return false;
}
......@@ -234,13 +234,13 @@ bool jconf::parse_config(const char* sFilename)
if(prv->configValues[i] == nullptr)
{
printer::inst()->print_msg(L0, "Invalid config file. Missing value \"%s\".", oConfigValues[i].sName);
printer::inst()->print_msg(L0, "Invalid config file '%s'. Missing value \"%s\".", sFilename, oConfigValues[i].sName);
return false;
}
if(!checkType(prv->configValues[i]->GetType(), oConfigValues[i].iType))
{
printer::inst()->print_msg(L0, "Invalid config file. Value \"%s\" has unexpected type.", oConfigValues[i].sName);
printer::inst()->print_msg(L0, "Invalid config file '%s'. Value \"%s\" has unexpected type.", sFilename, oConfigValues[i].sName);
return false;
}
}
......
......@@ -235,15 +235,15 @@ bool jconf::parse_config(const char* sFilename)
if(prv->jsonDoc.HasParseError())
{
printer::inst()->print_msg(L0, "JSON config parse error(offset %llu): %s",
int_port(prv->jsonDoc.GetErrorOffset()), GetParseError_En(prv->jsonDoc.GetParseError()));
printer::inst()->print_msg(L0, "JSON config parse error in '%s' (offset %llu): %s",
sFilename, int_port(prv->jsonDoc.GetErrorOffset()), GetParseError_En(prv->jsonDoc.GetParseError()));
return false;
}
if(!prv->jsonDoc.IsObject())
{ //This should never happen as we created the root ourselves
printer::inst()->print_msg(L0, "Invalid config file. No root?\n");
printer::inst()->print_msg(L0, "Invalid config file '%s'. No root?", sFilename);
return false;
}
......@@ -259,13 +259,13 @@ bool jconf::parse_config(const char* sFilename)
if(prv->configValues[i] == nullptr)
{
printer::inst()->print_msg(L0, "Invalid config file. Missing value \"%s\".", oConfigValues[i].sName);
printer::inst()->print_msg(L0, "Invalid config file '%s'. Missing value \"%s\".", sFilename, oConfigValues[i].sName);
return false;
}
if(!checkType(prv->configValues[i]->GetType(), oConfigValues[i].iType))
{
printer::inst()->print_msg(L0, "Invalid config file. Value \"%s\" has unexpected type.", oConfigValues[i].sName);
printer::inst()->print_msg(L0, "Invalid config file '%s'. Value \"%s\" has unexpected type.", sFilename, oConfigValues[i].sName);
return false;
}
}
......@@ -274,4 +274,4 @@ bool jconf::parse_config(const char* sFilename)
}
} // namespace nvidia
} // namespace xmrstak
\ No newline at end of file
} // namespace xmrstak
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment