Skip to content

Conform generic network errors to EdgeEventError type#217

Merged
emdobrin merged 1 commit intoadobe:devfrom
kevinlind:mob-14451
Oct 15, 2021
Merged

Conform generic network errors to EdgeEventError type#217
emdobrin merged 1 commit intoadobe:devfrom
kevinlind:mob-14451

Conversation

@kevinlind
Copy link
Copy Markdown
Contributor

Description

Generic network errors generated by the EdgeNetworkService would fail to be handled by the NetworkResponseHandler as they failed to encode to type EdgeEventError. This fix changes the generic network errors to conform to EdgeEventError so they are correctly handled and dispatched.

Related Issue

MOB-14451

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@kevinlind kevinlind requested a review from emdobrin October 15, 2021 05:30
@codecov
Copy link
Copy Markdown

codecov bot commented Oct 15, 2021

Codecov Report

Merging #217 (d6a08ff) into dev (cffb5d2) will increase coverage by 0.06%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##              dev     #217      +/-   ##
==========================================
+ Coverage   94.30%   94.37%   +0.06%     
==========================================
  Files          26       26              
  Lines         913      923      +10     
==========================================
+ Hits          861      871      +10     
  Misses         52       52              

dispatchEventErrors(errorsArray: edgeResponse.errors, requestId: requestId)
} else if let edgeErrorResponse = try? JSONDecoder().decode(EdgeEventError.self, from: data) {
// generic server error, return the error as is
Log.warning(label: LOG_TAG,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I removed this log message because it is redundant with the message on line 120.

@emdobrin emdobrin merged commit 8cf1db1 into adobe:dev Oct 15, 2021
@kevinlind kevinlind deleted the mob-14451 branch October 15, 2021 17:28
@emdobrin emdobrin added the bugfix Fixes a reported issue or bug label Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Fixes a reported issue or bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants