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

fix(all): Update to use user-friendly error message in API responses #3990

Merged
merged 1 commit into from
Apr 27, 2022

Conversation

jinlinGuan
Copy link
Contributor

fix #3975

This issue is actually located in all services, so fix it in all services.

Signed-off-by: Ginny Guan ginny@iotechsys.com

If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/edgex-go/blob/main/.github/Contributing.md

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?) only update response error messages
  • 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?)only update response error messages

Testing Instructions

  1. build and run docker images for all services from this branch
  2. verify the responses
    For example,
For empty profile name,
{"apiVersion":"v2","message":"DeviceProfileBasicInfoRequest.BasicInfo.Name field should not be empty string","statusCode":400}
For non-existent profile name,
[{"apiVersion":"v2","message":"fail to query device profile by name test","statusCode":404}]

New Dependency Instructions (If applicable)

fix edgexfoundry#3975

This issue is actually located in all services, so fix it in all services.

Signed-off-by: Ginny Guan <ginny@iotechsys.com>
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
12.2% 12.2% Duplication

@codecov-commenter
Copy link

Codecov Report

Merging #3990 (aeaf064) into main (8a434ef) will not change coverage.
The diff coverage is 15.38%.

@@           Coverage Diff           @@
##             main    #3990   +/-   ##
=======================================
  Coverage   47.19%   47.19%           
=======================================
  Files         114      114           
  Lines        9831     9831           
=======================================
  Hits         4640     4640           
  Misses       4804     4804           
  Partials      387      387           
Impacted Files Coverage Δ
internal/pkg/infrastructure/redis/client.go 0.00% <0.00%> (ø)
...nternal/pkg/infrastructure/redis/device_profile.go 0.00% <0.00%> (ø)
...nternal/pkg/infrastructure/redis/device_service.go 0.00% <0.00%> (ø)
internal/pkg/infrastructure/redis/interval.go 0.00% <0.00%> (ø)
...nternal/pkg/infrastructure/redis/intervalaction.go 0.00% <0.00%> (ø)
...ernal/pkg/infrastructure/redis/provisionwatcher.go 0.00% <0.00%> (ø)
...nal/core/metadata/controller/http/devicecommand.go 100.00% <100.00%> (ø)
internal/io/reader.go 74.07% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8a434ef...aeaf064. Read the comment docs.

Copy link
Member

@cloudxxx8 cloudxxx8 left a comment

Choose a reason for hiding this comment

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

LGTM

@cloudxxx8 cloudxxx8 merged commit de46469 into edgexfoundry:main Apr 27, 2022
@jinlinGuan jinlinGuan deleted the issue-3975 branch April 27, 2022 04:58
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.

PATCH deviceprofile basicinfo API response non-user-friendly error message
3 participants