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

Use different return codes for different types of errors #141

Open
anzoman opened this issue Dec 16, 2020 · 0 comments
Open

Use different return codes for different types of errors #141

anzoman opened this issue Dec 16, 2020 · 0 comments
Labels
enhancement New feature or request

Comments

@anzoman
Copy link
Contributor

anzoman commented Dec 16, 2020

Description

Having different return codes for different types of errors could help users and developers indicate what error they are dealing with. This could be also useful for xOpera API and xOpera SaaS API to return better responses for the end users.

As things are now, we always return the code 1 regardless of error type. Opera has three main exception types (located in src/opera/error.py):

  • ParseError,
  • DataError and
  • OperationError.

I propose return codes 1, 2 and 3 for these and 4 for other exceptions.

Steps

To realize this we should update the return codes in all python files to be consistent.

Current behaviour

Right now opera uses only one return code for errors (1).

Expected results

To have different return codes for different types of errors (1, 2, 3, 4).

@anzoman anzoman added the enhancement New feature or request label Dec 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant