|
16 | 16 |
|
17 | 17 | from ...apps import NbGrader |
18 | 18 | from ...coursedir import CourseDirectory |
19 | | -from ...exchange import ExchangeList, ExchangeFetchAssignment, ExchangeFetchFeedback, ExchangeSubmit |
| 19 | +from ...exchange import ExchangeList, ExchangeFetchAssignment, ExchangeFetchFeedback, ExchangeSubmit, ExchangeError |
20 | 20 | from ...auth import Authenticator |
21 | 21 | from ... import __version__ as nbgrader_version |
22 | 22 |
|
@@ -76,11 +76,16 @@ def list_released_assignments(self, course_id=None): |
76 | 76 | config=config) |
77 | 77 | assignments = lister.start() |
78 | 78 |
|
79 | | - except: |
| 79 | + except ExchangeError: |
80 | 80 | self.log.error(traceback.format_exc()) |
81 | 81 | retvalue = { |
82 | 82 | "success": False, |
83 | | - "value": traceback.format_exc() |
| 83 | + "value": """The exchange directory does not exist and could |
| 84 | + not be created. The "release" and "collect" functionality will not be available. |
| 85 | + Please see the documentation on |
| 86 | + http://nbgrader.readthedocs.io/en/stable/user_guide/managing_assignment_files.html#setting-up-the-exchange |
| 87 | + for instructions. |
| 88 | + """ |
84 | 89 | } |
85 | 90 |
|
86 | 91 | else: |
@@ -111,11 +116,16 @@ def list_submitted_assignments(self, course_id=None): |
111 | 116 | config=config) |
112 | 117 | assignments = lister.start() |
113 | 118 |
|
114 | | - except: |
| 119 | + except ExchangeError: |
115 | 120 | self.log.error(traceback.format_exc()) |
116 | 121 | retvalue = { |
117 | 122 | "success": False, |
118 | | - "value": traceback.format_exc() |
| 123 | + "value": """The exchange directory does not exist and could |
| 124 | + not be created. The "release" and "collect" functionality will not be available. |
| 125 | + Please see the documentation on |
| 126 | + http://nbgrader.readthedocs.io/en/stable/user_guide/managing_assignment_files.html#setting-up-the-exchange |
| 127 | + for instructions. |
| 128 | + """ |
119 | 129 | } |
120 | 130 |
|
121 | 131 | else: |
|
0 commit comments