Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1512)

Unified Diff: codereview/views.py

Issue 5449109: Move FetchError to codereview.exceptions. (Closed)
Patch Set: Created 12 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« codereview/exceptions.py ('K') | « codereview/models.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: codereview/views.py
===================================================================
--- a/codereview/views.py
+++ b/codereview/views.py
@@ -57,6 +57,7 @@
import library
import models
import patching
+from codereview.exceptions import FetchError
# Add our own template library.
@@ -2406,7 +2407,7 @@
else:
try:
rows = _get_diff_table_rows(request, patch, context, column_width)
- except engine.FetchError, err:
+ except FetchError, err:
return HttpResponseNotFound(str(err))
_add_next_prev(patchset, patch)
@@ -2427,13 +2428,13 @@
"""Helper function that returns rendered rows for a patch.
Raises:
- engine.FetchError if patch parsing or download of base files fails.
+ FetchError if patch parsing or download of base files fails.
"""
chunks = patching.ParsePatchToChunks(patch.lines, patch.filename)
if chunks is None:
- raise engine.FetchError('Can\'t parse the patch to chunks')
-
- # Possible engine.FetchErrors are handled in diff() and diff_skipped_lines().
+ raise FetchError('Can\'t parse the patch to chunks')
+
+ # Possible FetchErrors are handled in diff() and diff_skipped_lines().
content = request.patch.get_content()
rows = list(engine.RenderDiffTableRows(request, content.lines,
@@ -2478,7 +2479,7 @@
try:
rows = _get_diff_table_rows(request, patch, None, column_width)
- except engine.FetchError, err:
+ except FetchError, err:
return HttpResponse('Error: %s; please report!' % err, status=500)
return _get_skipped_lines_response(rows, id_before, id_after, where, context)
@@ -2566,7 +2567,7 @@
if patch_left:
try:
new_content_left = patch_left.get_patched_content()
- except engine.FetchError, err:
+ except FetchError, err:
return HttpResponseNotFound(str(err))
lines_left = new_content_left.lines
elif patch_right:
@@ -2577,7 +2578,7 @@
if patch_right:
try:
new_content_right = patch_right.get_patched_content()
- except engine.FetchError, err:
+ except FetchError, err:
return HttpResponseNotFound(str(err))
lines_right = new_content_right.lines
elif patch_left:
@@ -3108,7 +3109,7 @@
else:
new_lines = patch.get_patched_content().text.splitlines(True)
linecache[last_key] = new_lines
- except engine.FetchError:
+ except FetchError:
linecache[last_key] = patching.ParsePatchToLines(patch.lines)
fetch_base_failed = True
file_lines = linecache[last_key]
« codereview/exceptions.py ('K') | « codereview/models.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b