|
22 | 22 | import debsources.statistics as statistics
|
23 | 23 | from debsources.excepts import (Http404ErrorSuggestions, FileOrFolderNotFound,
|
24 | 24 | InvalidPackageOrVersionError,
|
25 |
| - Http404MissingCopyright, Http404Error) |
| 25 | + Http404MissingCopyright, Http404Error, |
| 26 | + CopyrightValueError) |
26 | 27 | from ..views import GeneralView, ChecksumView, session, app
|
27 | 28 | from ..sourcecode import SourceCodeIterator
|
28 | 29 | from ..pagination import Pagination
|
@@ -74,13 +75,16 @@ def get_objects(self, path_to):
|
74 | 75 | code=sourcefile,
|
75 | 76 | dump='True',
|
76 | 77 | nlines=sourcefile.get_number_of_lines(),)
|
77 |
| - return dict(package=package, |
78 |
| - version=version, |
79 |
| - dump='False', |
80 |
| - header=helper.get_copyright_header(c), |
81 |
| - files=helper.parse_copyright_paragraphs_for_html_render( |
82 |
| - c, "/src/" + package + "/" + version + "/"), |
83 |
| - licenses=helper.parse_licenses_for_html_render(c)) |
| 78 | + try: |
| 79 | + return dict(package=package, |
| 80 | + version=version, |
| 81 | + dump='False', |
| 82 | + header=helper.get_copyright_header(c), |
| 83 | + files=helper.parse_copyright_paragraphs_html_render( |
| 84 | + c, "/src/" + package + "/" + version + "/"), |
| 85 | + licenses=helper.parse_licenses_for_html_render(c)) |
| 86 | + except ValueError as e: |
| 87 | + raise CopyrightValueError(package, version, e.message) |
84 | 88 |
|
85 | 89 |
|
86 | 90 | class ChecksumLicenseView(ChecksumView):
|
|
0 commit comments