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

Error returns from postUpdateContext #2763

Closed
kzangeli opened this issue Dec 12, 2016 · 4 comments
Closed

Error returns from postUpdateContext #2763

kzangeli opened this issue Dec 12, 2016 · 4 comments

Comments

@kzangeli
Copy link
Member

kzangeli commented Dec 12, 2016

Right now it seems we have no less than three ways to return errors in the service routine postUpdateContext.

See postEntities.cpp, after the call to postUpdateContext:

  • ciP->httpStatusCode
  • parseDataP->upcrs.res.oe.code != SccNone
  • parseDataP->upcrs.res.errorCode.code != SccNone (or similar)

It would be good to have one way of detecting errors, not three ...

@kzangeli kzangeli added the bug label Dec 12, 2016
@kzangeli kzangeli added this to the 1.7.0 milestone Dec 12, 2016
@fgalan fgalan added the P6 label Dec 12, 2016
@fgalan fgalan modified the milestones: Refactors, 1.7.0 Dec 12, 2016
@fgalan
Copy link
Member

fgalan commented Jan 18, 2017

(PR #2821 is referred here, as there was a bug related with this issue that was fixed in that PR). The bug was:

attempt to create an entity with an error in service path (and probably more types of errors) now returns '400 Bad Request', not '200 OK'

@Anjali-NEC
Copy link
Contributor

Hi @fgalan @kzangeli
I would like to work on this issue, please let me know this issue is still valid or not.

@fgalan
Copy link
Member

fgalan commented Jan 17, 2022

The issue is still valid but before starting to implement it I think it needs a analysis phase to identify what to be exactly done. Thus maybe its better you choose another issue with a more straightforward task to do.

@fgalan
Copy link
Member

fgalan commented Sep 11, 2024

After 4125c4d in PR #4603 (maybe even before?) there is only one way of returning in the service routine postUpdateContext, which is parseDataP->upcrs.res.oe.code != SccNone

For instance in postEntities() routine now we have:

  //
  // 03. Check error
  //
  std::string  answer = "";
  if (parseDataP->upcrs.res.error.code != SccOk)
  {
    ciP->httpStatusCode = parseDataP->upcrs.res.error.code;
    TIMED_RENDER(answer = parseDataP->upcrs.res.error.toJson());
    ciP->answer         = answer;
  }
  else
  {
  ...
  }

Thus this issue can be considered to be solved.

@fgalan fgalan closed this as completed Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants