Address error if errata is already present#27
Merged
Conversation
Contributor
Author
Contributor
Author
|
@stevemeier this is best reviewed by ignoring whitespace changes 😅 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem description
This patch prevents the following error:
This happens in case
errataImport.plis trying to add an errata where a published errata that is not linked to any channel already exists.This can happen, for example, after a channel is deleted - published errata that was only in that channel are not cleaned up.
Such published errata can be found via this one-liner:
Solution details
As there is currently no API to get a full list of errata including those not in channels, this patch makes
errataImport.plfail gracefully at errata creation time when the errata already exists by catching the exception and ignoring it selectively.I am no Perl expert, but my understanding is that the previous code did not really work as intended, as following the condition was always met:
In case of fault, Frontier would in fact
dieprior this condition was hit and not return a$resulthash at all. So here I am usingevalto catch the exceptional case.HTH!
Fixes #20