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

Capture all Netkan error text after first hyphen #63

Merged
merged 1 commit into from
May 6, 2018

Conversation

HebaruSan
Copy link
Member

Problem

The status page currently truncates error messages.

If you try to process CareerModePartCostNullifer manually with netkan.exe, it says:

2656 [1] FATAL CKAN.NetKAN.Program (null) - C:\Users\User\AppData\Local\Temp\CdFileMgr\303747d7-0830-4d.tmp is not a valid ZIP file: Error in step EntryHeader for Budget part cost set to 0.cfg: Exception during test - 'Compression method not supported'

But the status page only says: 'Compression method not supported'

Cause

This line extracts everything after the final hyphen in the output:

$error =~ m{FATAL.+.-.(.+)}m;

The first .+ matches as many characters as it can, including hyphens if there are multiple. So the (.+) part only matches the text after the last hyphen.

Changes

Now the .+ in that regex is changed to .+?, which makes it non-greedy, so the regex's hyphen will match the first one in the output rather than the last one. This will make the (.+) match the whole error.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 91.677% when pulling 49e3508 on fix/error-parsing into 81751de on master.

@HebaruSan HebaruSan added the bug label Mar 26, 2018
@techman83
Copy link
Member

Once my family heads back I'll make some time to sort out the Bot PRs @HebaruSan

@techman83
Copy link
Member

Ok, merging this in. I'll add a test and fix the broken ones.

@techman83 techman83 merged commit eab96a9 into master May 6, 2018
@techman83 techman83 deleted the fix/error-parsing branch May 6, 2018 03:59
techman83 added a commit to techman83/NetKAN-bot that referenced this pull request May 6, 2018
@techman83 techman83 mentioned this pull request May 6, 2018
@techman83
Copy link
Member

@HebaruSan done + deployed 🙂

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants