Commit 8991cdd3 by Calen Pennington

Stop raising BaseExceptions

parent 7977491d
...@@ -37,10 +37,10 @@ def get_course_location_for_item(location): ...@@ -37,10 +37,10 @@ def get_course_location_for_item(location):
# make sure we found exactly one match on this above course search # make sure we found exactly one match on this above course search
found_cnt = len(courses) found_cnt = len(courses)
if found_cnt == 0: if found_cnt == 0:
raise BaseException('Could not find course at {0}'.format(course_search_location)) raise Exception('Could not find course at {0}'.format(course_search_location))
if found_cnt > 1: if found_cnt > 1:
raise BaseException('Found more than one course at {0}. There should only be one!!! Dump = {1}'.format(course_search_location, courses)) raise Exception('Found more than one course at {0}. There should only be one!!! Dump = {1}'.format(course_search_location, courses))
location = courses[0].location location = courses[0].location
......
...@@ -49,7 +49,7 @@ def replace(static_url, prefix=None, course_namespace=None): ...@@ -49,7 +49,7 @@ def replace(static_url, prefix=None, course_namespace=None):
# use the utility functions in StaticContent.py # use the utility functions in StaticContent.py
if static_url.group('prefix') == '/static/' and not isinstance(modulestore(), XMLModuleStore): if static_url.group('prefix') == '/static/' and not isinstance(modulestore(), XMLModuleStore):
if course_namespace is None: if course_namespace is None:
raise BaseException('You must pass in course_namespace when remapping static content urls with MongoDB stores') raise Exception('You must pass in course_namespace when remapping static content urls with MongoDB stores')
url = StaticContent.convert_legacy_static_url(static_url.group('rest'), course_namespace) url = StaticContent.convert_legacy_static_url(static_url.group('rest'), course_namespace)
else: else:
url = try_staticfiles_lookup(prefix + static_url.group('rest')) url = try_staticfiles_lookup(prefix + static_url.group('rest'))
......
...@@ -314,10 +314,10 @@ class MongoModuleStore(ModuleStoreBase): ...@@ -314,10 +314,10 @@ class MongoModuleStore(ModuleStoreBase):
# make sure we found exactly one match on this above course search # make sure we found exactly one match on this above course search
found_cnt = len(courses) found_cnt = len(courses)
if found_cnt == 0: if found_cnt == 0:
raise BaseException('Could not find course at {0}'.format(course_search_location)) raise Exception('Could not find course at {0}'.format(course_search_location))
if found_cnt > 1: if found_cnt > 1:
raise BaseException('Found more than one course at {0}. There should only be one!!! Dump = {1}'.format(course_search_location, courses)) raise Exception('Found more than one course at {0}. There should only be one!!! Dump = {1}'.format(course_search_location, courses))
return courses[0] return courses[0]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment