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 device/group information to error log about some errors #1582

Merged
merged 17 commits into from
Feb 22, 2024

Conversation

AlvaroVega
Copy link
Member

@AlvaroVega AlvaroVega commented Feb 21, 2024

  • EntityGenericError
  • BadTimestamp
  • TypeNotFound
  • DeviceNotFound
  • MissingAttributes
  • DuplicateDeviceId
  • DuplicateGroup
  • CommandNotFound
  • GroupNotFound
  • BadGeocoordinates

@AlvaroVega
Copy link
Member Author

related: #1536

@AlvaroVega
Copy link
Member Author

AlvaroVega commented Feb 22, 2024

curl -i -X POST 'http://localhost:7897/iot/json?i=dispNew&k=izc9cokegoy7kyfgdd6etipt6&t=null' -d '{ "c": 3, "d": 4}' -H 'content-type: application/json'
HTTP/1.1 404 Not Found

{"name":"DEVICE_GROUP_NOT_FOUND","message":"Couldn\t find device group for fields: ["resource","apikey"] and values: {"resource":"/iot/json","apikey":"izc9cokegoy7kyfgdd6etipt6"}"}

and

curl -i -X POST 'http://localhost:7897/iot/json?i=dispNew&k=zrvj173zhvzb12t233z48vg96&t=null' -d '{ "c": 3, "d": 4}' -H 'content-type: application/json'
HTTP/1.1 400 Bad Request

{"name":"BAD_TIMESTAMP","message":"Invalid ISO8601 timestamp [null] in [thing:dispNew] with: {"lazy":[],"commands":[],"staticAttributes":[],"_id":"65d6f363f2a300f0ee1ab67b","creationDate":"2024-02-22T07:10:27.765Z","id":"dispNew","type":"thing","name":"thing:dispNew","service":"smartcity","subservice":"/","apikey":"zrvj173zhvzb12t233z48vg96","protocol":"IoTA-JSON","__v":0,"active":[],"subscriptions":[],"timestamp":true}"}

@AlvaroVega AlvaroVega changed the title add TypeInformation to error log about some errors add device/group information to error log about some errors Feb 22, 2024
@AlvaroVega AlvaroVega marked this pull request as ready for review February 22, 2024 10:13
CHANGES_NEXT_RELEASE Outdated Show resolved Hide resolved
@@ -600,7 +600,7 @@ describe('NGSI-LD - Active attributes test', function () {
should.exist(error.name);
error.code.should.equal(207);
error.details.notUpdated.should.equal('someEntities');
error.message.should.equal('Error accesing entity data for device: light1 of type: Light');
//error.message.should.equal('Error accesing entity data for device: light1 of type: Light');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this line be "recovered" ?

Suggested change
//error.message.should.equal('Error accesing entity data for device: light1 of type: Light');
error.message.should.equal('Error accesing entity data for device: light1 of type: Light');

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not, current message is more large and include a lot of fields of device.

Copy link
Member

@fgalan fgalan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fgalan fgalan merged commit 46fbcb2 into master Feb 22, 2024
7 checks passed
@fgalan fgalan deleted the task/add_typeInformation_in_errors branch February 22, 2024 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants