Skip to content
This repository has been archived by the owner on Apr 13, 2021. It is now read-only.

Commit

Permalink
Merge pull request #34 from techman83/error_parse_issue
Browse files Browse the repository at this point in the history
Parse multiline fatal errors
  • Loading branch information
techman83 committed Sep 7, 2015
2 parents 5ee2870 + 9972d12 commit 0cb918a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/App/KSP_CKAN/Tools/NetKAN.pm
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ method _check_lite {

method _parse_error($error) {
my $return;
if ($error =~ /^\d+.\[\d+\].FATAL/) {
$error =~ m{FATAL.+.-.(.+)};
if ($error =~ /^\d+.\[\d+\].FATAL/m) {
$error =~ m{FATAL.+.-.(.+)}m;
$return = $1;
} else {
$error =~ m{^\[ERROR\].(.+)}m;
Expand Down
6 changes: 6 additions & 0 deletions t/App/KSP_CKAN/Tools/NetKAN.t
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ EOF
"Generic Error Parsing Success"
);

is (
$netkan->_parse_error("791 [1] WARN CKAN.Curl (null) - Curl environment not pre-initialised, performing non-threadsafe init.\n8194 [1] FATAL CKAN.NetKAN.Program (null) - Could not find CrowdSourcedScience directory in zipfile to install"),
"Could not find CrowdSourcedScience directory in zipfile to install",
"Mutliline Fatal Success"
);

is (
$netkan->_parse_error( "Cookie Cat Crystal Combo powers... ACTIVATE" ),
"Error wasn't parsable",
Expand Down

0 comments on commit 0cb918a

Please sign in to comment.