-
Notifications
You must be signed in to change notification settings - Fork 84
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
refactor(sdk): implement error interface for MessageError #1270
refactor(sdk): implement error interface for MessageError #1270
Conversation
Closes: edgexfoundry#1125 Signed-off-by: Marc-Philippe Fuller <[email protected]>
5c92b9b
to
d8ea12a
Compare
internal/runtime/runtime_test.go
Outdated
@@ -269,8 +269,8 @@ func TestProcessMessageTransformError(t *testing.T) { | |||
msgErr := runtime.ProcessMessage(context, messageData, runtime.GetDefaultPipeline()) | |||
|
|||
require.NotNil(t, msgErr, "Expected an error") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one can now be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
require.NotNil
has been removed
internal/runtime/runtime_test.go
Outdated
@@ -449,7 +449,7 @@ func TestDecode_Process_MessageTargetType(t *testing.T) { | |||
targetData, err, _ := runtime.DecodeMessage(context, envelope) | |||
if currentTest.ErrorExpected { | |||
assert.NotNil(t, err, fmt.Sprintf("expected an error for test '%s'", currentTest.Name)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one can now be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assert.NotNil
has been removed
@@ -82,6 +82,10 @@ type MessageError struct { | |||
ErrorCode int | |||
} | |||
|
|||
func (merr *MessageError) Error() string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect!
Signed-off-by: Marc-Philippe Fuller <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Closes: #1125
Signed-off-by: Marc-Philippe Fuller [email protected]
If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/app-functions-sdk-go/blob/main/.github/CONTRIBUTING.md
PR Checklist
Please check if your PR fulfills the following requirements:
BREAKING CHANGE:
describing the break)Testing Instructions
make test
New Dependency Instructions (If applicable)