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 types should be only ETSI URIs #22

Closed
jmcanterafonseca opened this issue Nov 22, 2018 · 2 comments
Closed

Error types should be only ETSI URIs #22

jmcanterafonseca opened this issue Nov 22, 2018 · 2 comments
Assignees
Labels

Comments

@jmcanterafonseca
Copy link

jmcanterafonseca commented Nov 22, 2018

I have noticed that sometimes error payloads are generated as follows:

"type": "http://example.org/ngsi-ld/errors/ResourceNotFound" 

Error payloads "type" member shall always contain ETSI-defined URIs:

Error Type HTTP status
http://uri.etsi.org/ngsi-ld/errors/InvalidRequest 400
http://uri.etsi.org/ngsi-ld/errors/BadRequestData 400
http://uri.etsi.org/ngsi-ld/errors/AlreadyExists 409
http://uri.etsi.org/ngsi-ld/errors/OperationNotSupported 422
http://uri.etsi.org/ngsi-ld/errors/ResourceNotFound 404
http://uri.etsi.org/ngsi-ld/errors/InternalError 500
http://uri.etsi.org/ngsi-ld/errors/TooComplexQuery 403
http://uri.etsi.org/ngsi-ld/errors/TooManyResults 403
@kzangeli
Copy link
Collaborator

Yeah, not sometimes, more like always.
This is how the conversion to error string is implemented:

// -----------------------------------------------------------------------------
//
// errorTypeStringV -
//
static const char* errorTypeStringV[] =
{
  "http://example.org/ngsi-ld/errors/InvalidRequest",
  "http://example.org/ngsi-ld/errors/BadRequestData",
  "http://example.org/ngsi-ld/errors/AlreadyExists",
  "http://example.org/ngsi-ld/errors/OperationNotSupported",
  "http://example.org/ngsi-ld/errors/ResourceNotFound",
  "http://example.org/ngsi-ld/errors/InternalError"
};

Seems like there's been a change in the spec.
Not a problem, very easy to fix.

@kzangeli kzangeli self-assigned this Nov 22, 2018
@kzangeli kzangeli added the bug Something isn't working label Nov 22, 2018
@kzangeli
Copy link
Collaborator

Fixed in ec8501e

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

No branches or pull requests

2 participants