Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export foundry-dev-tool errors such as DatasetHasOpenTransactionError #5

Open
4 tasks done
KochC opened this issue Mar 9, 2023 · 4 comments
Open
4 tasks done
Labels
good first issue Good for newcomers

Comments

@KochC
Copy link
Contributor

KochC commented Mar 9, 2023

Issue checklist

  • This is a feature request/enhancement. And not a bug.
  • I searched through the GitHub issues and this feature/enhancement has not been requested before.
  • I have installed the latest version of Foundry DevTools and don't use an unsupported python version.
  • Others could also benefit from this feature or enhancement and it is not a very specific use case.

Feature use case

The export of Error types would make it possible to catch raised errors and handle them accordingly.

Description of the Feature

An import of the errors like

from foundry_dev_tools import DatasetHasOpenTransactionError

try:
   # something
except DatasetHasOpenTransactionError as e:
  # something else
except:
  # whatever

would be great.

Alternatives you considered

An import of the errors like

from foundry_dev_tools import Errors

try:
   # something
except Errors.DatasetHasOpenTransactionError as e:
  # something else
except:
  # whatever

would be great.

Additional Context

I

@jonas-w jonas-w added the good first issue Good for newcomers label Mar 9, 2023
@jonas-w
Copy link
Collaborator

jonas-w commented Mar 9, 2023

I think it's possible to import them via:

from foundry_dev_tools.foundry_api_client import DatasetHasOpenTransactionError

Nevertheless, I agree that this needs another solution.

Personally, I think the second approach is better because the top-level module will otherwise become too cluttered.

Will have a look at it tomorrow!

@KochC
Copy link
Contributor Author

KochC commented Mar 9, 2023

@jonas-w thanks, this works as a workaround 😀

@jonas-w
Copy link
Collaborator

jonas-w commented Mar 17, 2023

@KochC are you still interested in contributing?

@KochC
Copy link
Contributor Author

KochC commented Mar 20, 2023

@jonas-w working on a first draft already 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants