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

Refactoring of exceptions #114

Merged
merged 8 commits into from
Feb 9, 2017
Merged

Refactoring of exceptions #114

merged 8 commits into from
Feb 9, 2017

Conversation

TamoshaytisV
Copy link

@TamoshaytisV TamoshaytisV commented Feb 8, 2017

I think it's a good idea to have base video xblock exceptions to distinguish them from other bad code.

@z4y4ts @dorosh please review

@TamoshaytisV
Copy link
Author

@OPersian please also review

@TamoshaytisV TamoshaytisV requested a review from OPersian February 9, 2017 11:15
Copy link

@z4y4ts z4y4ts left a 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.

@@ -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 '
Copy link

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

fixed

Base class for video xblock exceptions.
Subclasses should provide `.default_detail` property.
"""
default_detail = _('An exception occurred.')
Copy link

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.

Copy link
Author

Choose a reason for hiding this comment

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

changed

"""
Base API client exception.
"""
default_detail = _('API error occurred.')
Copy link

Choose a reason for hiding this comment

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

add last blank string

Copy link

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 ↵∅

Copy link
Author

Choose a reason for hiding this comment

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

it was there :)

Copy link

@OPersian OPersian left a comment

Choose a reason for hiding this comment

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

👍

@TamoshaytisV
Copy link
Author

@z4y4ts please continue review

@z4y4ts
Copy link

z4y4ts commented Feb 9, 2017

Squash and merge.

@TamoshaytisV TamoshaytisV merged commit 176880e into dev Feb 9, 2017
z4y4ts added a commit that referenced this pull request Feb 9, 2017
* 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
@z4y4ts z4y4ts deleted the refactoring/exceptions branch February 20, 2017 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants