-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Unify error handling with the cloud storage #5389
Merged
Merged
Changes from 14 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
94a0188
Unify error handling with the cloud storage
Marishka17 6bc631d
Add test
Marishka17 8bfd599
Some fixes
Marishka17 3fd8c48
Update export/import annotations/backups
Marishka17 80d0692
Fix black issues
Marishka17 b1aef61
Fix pylint issue
Marishka17 2c954de
Skip bandit issue
Marishka17 ea1e2d2
Fix codeql issues
Marishka17 e814ed5
[skip ci] Update changelog
Marishka17 f16a28a
Merge branch 'develop' into mk/improve_exception_message
nmanovic 875401e
Merge branch 'develop' into mk/improve_exception_message
nmanovic 6c251ad
Apply comments
Marishka17 730c732
Merge branch 'develop' into mk/improve_exception_message
Marishka17 ebae27c
Merge branch 'mk/improve_exception_message' of https://github.com/ope…
Marishka17 a552a91
Merge branch 'develop' into mk/improve_exception_message
nmanovic File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,17 +110,30 @@ def parse_specific_attributes(specific_attributes): | |
} if parsed_specific_attributes else dict() | ||
|
||
|
||
def parse_exception_message(msg): | ||
parsed_msg = msg | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably need to handle a case when msg is empty by a reason. Please resolve a conflict and see the case. |
||
try: | ||
if 'ErrorDetail' in msg: | ||
# msg like: 'rest_framework.exceptions.ValidationError: | ||
# [ErrorDetail(string="...", code=\'invalid\')]\n' | ||
parsed_msg = msg.split('string=')[1].split(', code=')[0].strip("\"") | ||
elif msg.startswith('rest_framework.exceptions.'): | ||
parsed_msg = msg.split(':')[1].strip() | ||
except Exception: # nosec | ||
pass | ||
return parsed_msg | ||
|
||
def process_failed_job(rq_job): | ||
if rq_job.meta['tmp_file_descriptor']: | ||
os.close(rq_job.meta['tmp_file_descriptor']) | ||
if os.path.exists(rq_job.meta['tmp_file']): | ||
os.remove(rq_job.meta['tmp_file']) | ||
exc_info = str(rq_job.exc_info) or str(rq_job.dependency.exc_info) | ||
exc_info = str(rq_job.exc_info or rq_job.dependency.exc_info) | ||
if rq_job.dependency: | ||
rq_job.dependency.delete() | ||
rq_job.delete() | ||
|
||
return exc_info | ||
return parse_exception_message(exc_info) | ||
|
||
def configure_dependent_job(queue, rq_id, rq_func, db_storage, filename, key): | ||
rq_job_id_download_file = rq_id + f'?action=download_{filename}' | ||
|
Oops, something went wrong.
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.
Check warning
Code scanning / CodeQL
Information exposure through an exception