Skip to content

Remove UrlNotDvcRepoError from exc for dvc.api#1763

Merged
shcheklein merged 1 commit into
masterfrom
skshetry/api-exc-update
Sep 16, 2020
Merged

Remove UrlNotDvcRepoError from exc for dvc.api#1763
shcheklein merged 1 commit into
masterfrom
skshetry/api-exc-update

Conversation

@skshetry
Copy link
Copy Markdown
Collaborator

@skshetry skshetry commented Sep 8, 2020

We added support for subrepos in treeverse/dvc#4465, due to which it made UrlNotDvcRepoError invalid and imprecise. So, we made a breaking change for the exceptions raised.

There's a lot of things that are wrong with exceptions for dvc.api, which I don't want to fix them here but on the core side (raise ApiError everywhere, perhaps?).

You may disregard these recommendations if you used the Edit on GitHub button from dvc.org to improve a doc in place.

❗ Please read the guidelines in the Contributing to the Documentation list if you make any substantial changes to the documentation or JS engine.

🐛 Please make sure to mention Fix #issue (if applicable) in the description of the PR. This causes GitHub to close it automatically when the PR is merged.

Please choose to allow us to edit your branch when creating the PR.

Thank you for the contribution - we'll try to review it as soon as possible. 🙏

@skshetry skshetry self-assigned this Sep 8, 2020
@shcheklein shcheklein temporarily deployed to dvc-landing-skshetry-ap-cgdqen September 8, 2020 09:46 Inactive
Comment thread content/docs/api-reference/open.md
Comment thread content/docs/api-reference/read.md
## Exceptions

- `dvc.api.UrlNotDvcRepoError` - `repo` is not a DVC project.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It returns a whole kinds of exceptions:

  1. PathMissingError
  2. OutputNotFoundError (local) / NoOutputInExternalRepoError (remote repo)
  3. NoRemoteError (local) / NoRemoteInExternalRepoError (remote repo)
  4. Possibly OutputNotFoundError again.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But, something to fix on the core repo.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So is UrlNotDvcRepoError not returned then? What do you recommend the docs say here for now? Whatever best represents the current behavior.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's leave it as-is for now, we should better fix this in the core by throwing only certain sets of exceptions, only ApiError perhaps?

Copy link
Copy Markdown
Contributor

@jorgeorpinel jorgeorpinel Sep 17, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, we already merged this PR where you removed that line. Should we put it back then? Or by "as-is" do you mean having nothing here is OK?

we should better fix this in the core by throwing only certain sets of exceptions, only ApiError perhaps?

Is there a core issue for that?

Thanks

Copy link
Copy Markdown
Contributor

@jorgeorpinel jorgeorpinel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay and thanks for this @skshetry

Trusting you on this one, feel free to merge.

## Exceptions

- `dvc.api.UrlNotDvcRepoError` - `repo` is not a DVC project.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So is UrlNotDvcRepoError not returned then? What do you recommend the docs say here for now? Whatever best represents the current behavior.

Comment thread content/docs/api-reference/open.md
Comment thread content/docs/api-reference/read.md
@shcheklein shcheklein merged commit f8444f5 into master Sep 16, 2020
@skshetry skshetry deleted the skshetry/api-exc-update branch September 17, 2020 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants