Skip to content

fix(dynamic-error): removed side effects to keep error cases consistent#91

Merged
asadali214 merged 5 commits intomainfrom
fix-dynamic-error-template-replacement
Jan 30, 2024
Merged

fix(dynamic-error): removed side effects to keep error cases consistent#91
asadali214 merged 5 commits intomainfrom
fix-dynamic-error-template-replacement

Conversation

@asadali214
Copy link
Copy Markdown
Collaborator

What

This PR adds a new method getReason in ErrorCase that replace replacePlaceHolder method. The getReason method returns a new error reason instead of replacing the placeHolders in the original reason.

Why

We needed to make sure that the GlobalConfigurations are not updated on performing any API Calls

Type of change

Select multiple if applicable.

  • 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 a breaking change)
  • Tests (adds or updates tests)
  • Documentation (adds or updates documentation)
  • Refactor (style improvements, performance improvements, code refactoring)
  • Revert (reverts a commit)
  • CI/Build (adds or updates a script, change in external dependencies)

Dependency Change

If a new dependency is being added, please ensure that it adheres to the following guideline https://github.com/apimatic/apimatic-codegen/wiki/Policy-of-adding-new-dependencies-in-the-core-libraries

Breaking change

If the PR is introducing a breaking change, please ensure that it adheres to the following guideline https://github.com/apimatic/apimatic-codegen/wiki/Guidelines-for-maintaining-core-libraries

Testing

List the steps that were taken to test the changes

Checklist

  • My code follows the coding conventions
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added new unit tests

@asadali214
Copy link
Copy Markdown
Collaborator Author

This PR should be merged in main after this PR is closed

@asadali214 asadali214 force-pushed the fix-dynamic-error-template-replacement branch from 9b35bf7 to 7f1c951 Compare January 30, 2024 07:22
@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@asadali214 asadali214 merged commit 31735d0 into main Jan 30, 2024
@asadali214 asadali214 deleted the fix-dynamic-error-template-replacement branch January 30, 2024 07:57
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.

Dynamic error messages are affected due to a side effect of replacePlaceHolder in ErrorCases

2 participants