-
Notifications
You must be signed in to change notification settings - Fork 17
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
Refactoring of exceptions #114
Conversation
@OPersian please also review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good in general.
Please fix long line break.
video_xblock/backends/base.py
Outdated
@@ -307,8 +303,8 @@ def get_transcript_language_parameters(lang_code): | |||
lang_code = lang_code[0:2] | |||
# Check on consistency with the pre-configured ALL_LANGUAGES | |||
if lang_code not in [language[0] for language in settings.ALL_LANGUAGES]: | |||
raise Exception('Not all the languages of transcripts fetched from video platform are ' | |||
'consistent with the pre-configured ALL_LANGUAGES') | |||
raise VideoXBlockException(_('Not all the languages of transcripts fetched from video platform are ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please follow Open edX JavaScript code style guide.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
video_xblock/exceptions.py
Outdated
Base class for video xblock exceptions. | ||
Subclasses should provide `.default_detail` property. | ||
""" | ||
default_detail = _('An exception occurred.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
default_msg
and msg
(or message
) feels more appropriate here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed
video_xblock/exceptions.py
Outdated
""" | ||
Base API client exception. | ||
""" | ||
default_detail = _('API error occurred.') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add last blank string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dorosh it's there. Otherwise, GitHub would show something like ↵∅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it was there :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@z4y4ts please continue review |
Squash and merge. |
* dev: Add markdownlint to .codeclimate.yml and fix minor README.md issues (#105) Tweak .travis.yml for faster build times and bump XBlock dependency (#113) Refactoring of exceptions (#114) added statuses constants (#111) Add comments into .editorconfig with a link to download page Add Default transcripts upload and Brightcove HLSe (#104) Bug/settings page studio (#103) Fix saving playback progress by correctly reading it from localStorage (#102) Move bower.json to root directory, add .bowerrc, add make deps target (#101) # Conflicts: # .travis.yml # Makefile # requirements.txt
I think it's a good idea to have base video xblock exceptions to distinguish them from other bad code.
@z4y4ts @dorosh please review