Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add exception handler for invalid tar files #1322

Merged
merged 1 commit into from
Apr 12, 2021

Conversation

oliverli
Copy link
Contributor

@oliverli oliverli commented Apr 6, 2021

Description

Wrap Archive.get_file_hierarchy in an exception handler, and return "Could not read archive" if an exception is thrown

Motivation and Context

Due to changes in lib/archive.rb, some invalid tar files will result in an ArgumentError being thrown, which causes a 500 error since the exception is not handled

How Has This Been Tested?

Tested with this submission

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation, which is located at Autolab Docs
  • I have updated the documentation accordingly, included in this PR

@amartinez116 amartinez116 requested a review from fanpu April 12, 2021 02:02
Copy link
Contributor

@fanpu fanpu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could replicate difference between master and this branch, code looks good too, LGTM

@oliverli oliverli merged commit 33c17b4 into master Apr 12, 2021
@oliverli oliverli deleted the oliverli/tarfile-exception-handler branch April 12, 2021 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants