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

Add generic status code for "invalid request" #2258

Closed
jphickey opened this issue Mar 20, 2023 · 2 comments · Fixed by #2259
Closed

Add generic status code for "invalid request" #2258

jphickey opened this issue Mar 20, 2023 · 2 comments · Fixed by #2259

Comments

@jphickey
Copy link
Contributor

Is your feature request related to a problem? Please describe.
CFE defines several generic status codes, which are not specific to any module. These can be used by any app/module to indicate common status conditions, for example:

  • CFE_SUCCESS
  • CFE_STATUS_NOT_IMPLEMENTED
  • CFE_STATUS_REQUEST_ALREADY_PENDING
  • CFE_STATUS_EXTERNAL_RESOURCE_FAIL

However none of these are really appropriate for a validation failure for a request - e.g. if a value was out of range, or something of that nature.

Describe the solution you'd like
Add the following generic status codes:

  • CFE_STATUS_VALIDATION_FAILURE: for requests/inputs that fail structural validations; this one can also be useful with TBL validation functions.
  • CFE_STATUS_RANGE_ERROR: for requests that pass structural validation, but an input value is outside the acceptable range.
  • CFE_STATUS_INCORRECT_STATE: for requests that are otherwise valid, but the current system state does not permit its acceptance.

Describe alternatives you've considered
Each app could define these status codes, but that would be redundant as these are common validation checks that every app should be doing on its inputs, so a common status code is warranted.

Requester Info
Joseph Hickey, Vantage Systems, Inc.

@thnkslprpt
Copy link
Contributor

Would help with this as well I think: nasa/CF#57

@skliper
Copy link
Contributor

skliper commented Mar 21, 2023

I like it. Even better if we could get to one set of status codes for cFS and a common status type provided from OSAL (extended by cFE/apps if needed). It's a pain to manage 2 to 3 different status code types. Maybe even consolidate error reporting and construct a default string or whatever... perror like, etc.

dzbaker added a commit that referenced this issue Mar 30, 2023
@dmknutsen dmknutsen added this to the Equuleus milestone May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants