You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
768 B

10 years ago
function formatLocation(raw, shortMessage)
10 years ago
{
10 years ago
var splitted = raw.split(':');
if (!shortMessage)
return qsTr("Error in line ") + splitted[1] + ", " + qsTr("character ") + splitted[2];
10 years ago
else
10 years ago
return "L" + splitted[1] + "," + "C" + splitted[2];
10 years ago
}
10 years ago
function extractErrorInfo(raw, shortMessage)
10 years ago
{
10 years ago
var _return = {};
var detail = raw.split('\n')[0];
var reg = detail.match(/:\d+:\d+:/g);
if (reg !== null)
10 years ago
{
10 years ago
_return.errorLocation = ErrorLocationFormater.formatLocation(reg[0], shortMessage);
_return.errorDetail = detail.replace(reg[0], "");
10 years ago
_return.line = reg[0].split(':')[1];
_return.column = reg[0].split(':')[2];
10 years ago
}
else
{
10 years ago
_return.errorLocation = "";
_return.errorDetail = detail;
10 years ago
_return.line = "";
_return.column = "";
10 years ago
}
10 years ago
return _return;
10 years ago
}