Commit ae22b4e7 by John Eskew

ResourceNotFoundError->ResourceNotFound

parent a4c6c64f
...@@ -6,7 +6,7 @@ import sys ...@@ -6,7 +6,7 @@ import sys
import textwrap import textwrap
from datetime import datetime from datetime import datetime
from fs.errors import ResourceNotFoundError from fs.errors import ResourceNotFound
from lxml import etree from lxml import etree
from path import Path as path from path import Path as path
from pkg_resources import resource_string from pkg_resources import resource_string
...@@ -260,7 +260,7 @@ class HtmlDescriptor(HtmlBlock, XmlDescriptor, EditingDescriptor): # pylint: di ...@@ -260,7 +260,7 @@ class HtmlDescriptor(HtmlBlock, XmlDescriptor, EditingDescriptor): # pylint: di
return definition, [] return definition, []
except (ResourceNotFoundError) as err: except ResourceNotFound as err:
msg = 'Unable to load file contents at path {0}: {1} '.format( msg = 'Unable to load file contents at path {0}: {1} '.format(
filepath, err) filepath, err)
# add more info and re-raise # add more info and re-raise
......
...@@ -25,7 +25,7 @@ from django.core.urlresolvers import reverse ...@@ -25,7 +25,7 @@ from django.core.urlresolvers import reverse
from django.http import Http404, QueryDict from django.http import Http404, QueryDict
from enrollment.api import get_course_enrollment_details from enrollment.api import get_course_enrollment_details
from edxmako.shortcuts import render_to_string from edxmako.shortcuts import render_to_string
from fs.errors import ResourceNotFoundError from fs.errors import ResourceNotFound
from lms.djangoapps.courseware.courseware_access_exception import CoursewareAccessException from lms.djangoapps.courseware.courseware_access_exception import CoursewareAccessException
from lms.djangoapps.courseware.exceptions import CourseAccessRedirect from lms.djangoapps.courseware.exceptions import CourseAccessRedirect
from opaque_keys.edx.keys import UsageKey from opaque_keys.edx.keys import UsageKey
...@@ -207,13 +207,13 @@ def find_file(filesystem, dirs, filename): ...@@ -207,13 +207,13 @@ def find_file(filesystem, dirs, filename):
dirs: a list of path objects dirs: a list of path objects
filename: a string filename: a string
Returns d / filename if found in dir d, else raises ResourceNotFoundError. Returns d / filename if found in dir d, else raises ResourceNotFound.
""" """
for directory in dirs: for directory in dirs:
filepath = path(directory) / filename filepath = path(directory) / filename
if filesystem.exists(filepath): if filesystem.exists(filepath):
return filepath return filepath
raise ResourceNotFoundError(u"Could not find {0}".format(filename)) raise ResourceNotFound(u"Could not find {0}".format(filename))
def get_course_about_section(request, course, section_key): def get_course_about_section(request, course, section_key):
...@@ -419,7 +419,7 @@ def get_course_syllabus_section(course, section_key): ...@@ -419,7 +419,7 @@ def get_course_syllabus_section(course, section_key):
course_id=course.id, course_id=course.id,
static_asset_path=course.static_asset_path, static_asset_path=course.static_asset_path,
) )
except ResourceNotFoundError: except ResourceNotFound:
log.exception( log.exception(
u"Missing syllabus section %s in course %s", u"Missing syllabus section %s in course %s",
section_key, course.location.to_deprecated_string() section_key, course.location.to_deprecated_string()
......
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