Commit

r3490:dcd7ad80 public

Description:

api: report better error when fetching a node that doesn't exist.

Commit status:

[Not Reviewed]

References:

Comments:

0 Commit comments 0 Inline Comments

Unresolved TODOs:

There are no unresolved TODOs

Author

-
Add another comment

r3490:dcd7ad801152 -

@@ -37,6 +37,7
37 from rhodecode.lib.ext_json import json
37 from rhodecode.lib.ext_json import json
38 from rhodecode.lib.exceptions import StatusChangeOnClosedPullRequestError
38 from rhodecode.lib.exceptions import StatusChangeOnClosedPullRequestError
39 from rhodecode.lib.vcs import RepositoryError
39 from rhodecode.lib.vcs import RepositoryError
40 from rhodecode.lib.vcs.exceptions import NodeDoesNotExistError
40 from rhodecode.model.changeset_status import ChangesetStatusModel
41 from rhodecode.model.changeset_status import ChangesetStatusModel
41 from rhodecode.model.comment import CommentsModel
42 from rhodecode.model.comment import CommentsModel
42 from rhodecode.model.db import (
43 from rhodecode.model.db import (
@@ -579,7 +580,9
579 node = ScmModel().get_node(
580 node = ScmModel().get_node(
580 repo, commit_id, file_path, extended_info=extended_info,
581 repo, commit_id, file_path, extended_info=extended_info,
581 content=content, max_file_bytes=max_file_bytes, cache=cache)
582 content=content, max_file_bytes=max_file_bytes, cache=cache)
582
583 except NodeDoesNotExistError:
584 raise JSONRPCError('There is no file in repo: `{}` at path `{}` for commit: `{}`'.format(
585 repo.repo_name, file_path, commit_id))
583 except Exception:
586 except Exception:
584 log.exception("Exception occurred while trying to get repo %s file",
587 log.exception("Exception occurred while trying to get repo %s file",
585 repo.repo_name)
588 repo.repo_name)
You need to be logged in to leave comments. Login now