Skip to content

Commit

Permalink
libcore|PackageLoader: Log syntax errors in package metadata
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Oct 26, 2015
1 parent f0ec6b8 commit 3304564
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
4 changes: 2 additions & 2 deletions doomsday/sdk/libcore/src/data/info.cpp
Expand Up @@ -551,8 +551,8 @@ DENG2_PIMPL(Info)
if(!element)
{
throw SyntaxError("Info::parseBlockElement",
QString("Block element was never closed, end of file encountered before '%1' was found (on line %2).")
.arg(endToken).arg(currentLine));
QString("Block element (on line %1) was never closed, end of file encountered before '%2' was found (on line %3).")
.arg(startLine).arg(endToken).arg(currentLine));
}
block->add(element);
}
Expand Down
9 changes: 7 additions & 2 deletions doomsday/sdk/libcore/src/filesys/packageloader.cpp
Expand Up @@ -21,6 +21,7 @@
#include "de/App"
#include "de/Version"
#include "de/Info"
#include "de/Log"

#include <QMap>

Expand Down Expand Up @@ -198,13 +199,17 @@ DENG2_PIMPL(PackageLoader)

list.append(path);
}
catch(Package::ValidationError const &)
catch(Package::ValidationError const &er)
{
// Not a loadable package.
qDebug() << i->first << ": Package is invalid:" << er.asText();
}
catch(Info::SyntaxError const &)
catch(Info::SyntaxError const &er)
{
// Not a loadable package.
LOG_RES_NOTE("\"%s\": Package has a syntax error: %s")
<< i->first
<< er.asText();
}

/// @todo Store the errors so that the UI can show a list of
Expand Down

0 comments on commit 3304564

Please sign in to comment.