Closed jmcanterafonseca closed 5 years ago
Contexts as arrays is implemented and working ... I implemented a functest creating the entity in the example above and ran into problems with the three last contexts:
kz@malika:context.Orion-LD> wget http://example.org/cim/commonTerms.jsonld
--2018-11-17 20:40:08-- http://example.org/cim/commonTerms.jsonld
Resolving example.org (example.org)... 93.184.216.34
Connecting to example.org (example.org)|93.184.216.34|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2018-11-17 20:40:09 ERROR 404: Not Found.
Replacing the last three contexts with ONE context: https://fiware.github.io/NGSI-LD_Tests/ldContext/testFullContext.jsonld
, i.e. an Array with two contexts and the creation is successful.
wget got a 404 Bad Request. orionld reports this result:
orionldRequestSend.cpp[46]:writeCallback : Got a chunk of 1270 bytes: <!doctype html>
...
[ I imagine I don't even look at the HTTP Status Code. The error could definitely be better ].
Please perform a new test with working context URLs.
This issue should be renamed to something like "Bad error reporting for contexts with an invalid URL ]
And instead of bug
this is a tech debt
.
I did look at the error code (from curl_easy_perform). However, the function returns 0 (OK) for 404 Bad Request ... :( Thanks to SOF I found away to tell curl_easy_perform to complain on non-200 HTTP Status code, so, now the error response is better.
See commit https://github.com/Fiware/context.Orion-LD/commit/398d9bc32bf83a68a8e366c9c98f7bdc43e6f302