Skip to content

Comments

fix: Correct error variable check#5337

Merged
judehung merged 1 commit intoedgexfoundry:mainfrom
FelixTing:issue-5336
Dec 23, 2025
Merged

fix: Correct error variable check#5337
judehung merged 1 commit intoedgexfoundry:mainfrom
FelixTing:issue-5336

Conversation

@FelixTing
Copy link
Member

@FelixTing FelixTing commented Dec 22, 2025

fix: #5336

PR Checklist

Please check if your PR fulfills the following requirements:

  • I am not introducing a breaking change (if you are, flag in conventional commit message with BREAKING CHANGE: describing the break)
  • I am not introducing a new dependency (add notes below if you are)
  • I have added unit tests for the new feature or bug fix (if not, why?)
  • I have fully tested (add details below) this the new feature or bug fix (if not, why?)
  • I have opened a PR for the related docs change (if not, why?)

Testing Instructions

Enable ExternalMQTT for core-command and query a device that doesn't exist. The errorCode in the response payload should be 1.

# Query
mosquitto_pub -t edgex/commandquery/request/test  \
  -m '{
    "apiVersion": "v3",
    "requestId": "e6e8a2f4-eb14-4649-9e2b-175247911369",
    "ContentType": "application/json",
    "queryParams": {
      "offset": "0",
      "limit": "20"
     }
  }'

# Response
edgex/commandquery/response {"apiVersion":"v3","receivedTopic":"edgex/commandquery/response","correlationID":"ccefa43c-1c27-4484-b227-b4f238b989f7","requestID":"e6e8a2f4-eb14-4649-9e2b-175247911369","errorCode":1,"payload":"failed to get commands by device name 'test': request failed, status code: 404, err: no device with name 'test' found","contentType":"text/plain"}

Signed-off-by: FelixTing <felix@iotechsys.com>
@FelixTing FelixTing requested a review from judehung December 22, 2025 15:39
@sonarqubecloud
Copy link

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 21.17%. Comparing base (3b327d4) to head (de2d417).

Files with missing lines Patch % Lines
...nternal/core/command/controller/messaging/utils.go 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5337   +/-   ##
=======================================
  Coverage   21.17%   21.17%           
=======================================
  Files         285      285           
  Lines       20958    20958           
=======================================
  Hits         4438     4438           
  Misses      16167    16167           
  Partials      353      353           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@judehung judehung left a comment

Choose a reason for hiding this comment

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

LGTM

@judehung judehung merged commit 5813055 into edgexfoundry:main Dec 23, 2025
7 checks passed
@FelixTing FelixTing deleted the issue-5336 branch December 23, 2025 01:41
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.

Incorrect error variable check in core-command messaging utils.go

3 participants