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

Add error codes to all exceptions #3278

Merged
merged 96 commits into from
Jan 31, 2022
Merged

Add error codes to all exceptions #3278

merged 96 commits into from
Jan 31, 2022

Conversation

johnsonwlu
Copy link
Contributor

@johnsonwlu johnsonwlu commented Jan 6, 2022

DRAFT pull request to test build not for merging

fil512 and others added 30 commits November 26, 2021 16:52
…Exception have the message string as the second parameter
…atements would better match the message response
…-20211126-error-codes

# Conflicts:
#	pom.xml
… errors which now use error codes. Also changed ResourceNotFoundException to include error codes in its messages.
@codecov
Copy link

codecov bot commented Jan 20, 2022

Codecov Report

Merging #3278 (f433ed0) into master (fc84fdc) will decrease coverage by 0.01%.
The diff coverage is 36.61%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #3278      +/-   ##
============================================
- Coverage     82.84%   82.82%   -0.02%     
+ Complexity    20492    20489       -3     
============================================
  Files          1369     1371       +2     
  Lines         73626    73584      -42     
  Branches      11064    11064              
============================================
- Hits          60993    60947      -46     
- Misses         8378     8385       +7     
+ Partials       4255     4252       -3     
Impacted Files Coverage Δ
...a/uhn/fhir/context/BaseRuntimeChildDefinition.java 69.23% <0.00%> (ø)
...ir/context/BaseRuntimeDeclaredChildDefinition.java 87.01% <0.00%> (ø)
...main/java/ca/uhn/fhir/context/FhirVersionEnum.java 82.41% <0.00%> (ø)
...uhn/fhir/context/RuntimeChildChoiceDefinition.java 90.47% <0.00%> (ø)
...n/fhir/context/RuntimeChildContainedResources.java 77.77% <0.00%> (ø)
...meChildPrimitiveEnumerationDatatypeDefinition.java 87.50% <0.00%> (ø)
...n/fhir/context/RuntimeChildResourceDefinition.java 73.91% <ø> (ø)
...ext/RuntimeChildUndeclaredExtensionDefinition.java 67.21% <0.00%> (ø)
...ir/context/RuntimeCompositeDatatypeDefinition.java 64.00% <0.00%> (ø)
...ir/context/RuntimePrimitiveDatatypeDefinition.java 69.49% <0.00%> (ø)
... and 437 more

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 fc84fdc...f433ed0. Read the comment docs.

@tadgh tadgh merged commit c42ecc5 into master Jan 31, 2022
@tadgh tadgh deleted the ks-20211126-error-codes branch January 31, 2022 21:10
michaelabuckley pushed a commit that referenced this pull request Jan 31, 2022
* Initial design of adding exception codes to exceptions

* Initial design of adding exception codes to exceptions

* change int module name to string

* add comment

* shorten message

* shorten message

* added checkstyle

* developing checker

* completed checkstyle plugin and unit test for it

* fix NPE

* fix checker so it ignores throws on exceptions that aren't new

* change parameter order in InvalidResponseException

* accept Msg.code() in any parameter since some exceptions like MessageException have the message string as the second parameter

* exclude generated files

* BIG COMMIT added error codes to all exception throws

* example test fix

* Modified tests such that the assert statements would better match the message responses.

* Modified additional tests such that the assert statements would better match the message responses.

* fix test

* merge master

* merge master

* Fourth commit of modified tests such that the assert statements would better match the message response

* Changes made to modify assert statements such that they match the new errors which now use error codes. Also changed ResourceNotFoundException to include error codes in its messages.

* Modified assert messages to better match new error codes

* Time Zone changes DRAFT. Certain tests pass in intellij and fail during mvn install

* Modified assert messages to better match new error codes

* Added comments for time zone fixes. Previous commit comment on time zone fixes was incorrect. By invaliding caches, all tests on both intellij and mvn install passed.

* Reverted changes on azure-pipelines.yml

* updated hapi-fhir version for checkstyle module

* changes to azure-pipelines.yml

* changes to azure-pipelines.yml

* change to pom.xml to include hapi-fhir-checkstyle in ALLMODULES

* changes to azure-piplines (these changes are to be reverted after testing)

* reverted changes to azure-piplines

* reverted change where hapi-fhir-checkstyle was added to pom.xml (hapi-fhir)

* Attempted fix on checkstyle build error

* modified azure-piplines.yml to change maven repository for checkstyle build

* Attempted fix on checkstyle build error

* checkstyle config location change for hapi-depoloyable-pom. (will be reverted if it does not work)

* attempted dependency add for hapi-depoloyable-pom. (will be reverted if it does not work)

* reverted changes for hapi-deployable-pom

* add javadoc

* update last code

* Attempted fix on checkstyle build error

* Finished adding in missing error codes to pass Checkstyle checks

* Test pipelining

* Fixing errors and bumping version (as suggested by Gary)

* Merge

* Fixing Checkstyle error

* Attempted fix for date error

* Add error code onto assert statement

* Add in a couple more error codes

* Fixing assert statements

* Bump to static version for dependency

* Adding error code to message

* Adding error codes to exceptions

* Adding error codes to exceptions

* Change to work with cdr branch

* Update to faulty error message

* Merge changes

* allow checkstyle pom to deploy

Co-authored-by: Ken Stevens <khstevens@gmail.com>
Co-authored-by: Simon Zuccherato <simon.zuccherato@smilecdr.com>
Co-authored-by: Predap <simon.zuccherato@gmail.com>
Co-authored-by: Predap <46201929+Predap@users.noreply.github.com>
Co-authored-by: Tadgh <garygrantgraham@gmail.com>
michaelabuckley added a commit that referenced this pull request Jan 31, 2022
* master:
  Add error codes to all exceptions (#3278)
  3156 multiple tag race condition (#3297)
  Fix globbing pattern for log files
  Update instance_validator.md (#3328)
  add needed dependendencies for mysql and mssql (#3343)
  Add okhttp dep
  3335 allow alternative character encoding length in searchparam (#3336)
  Fix mdm config for single application context environment.  (#3338)
  Validate include statements for JPA (#3331)
  Add okhttp dep to r5 and indicate which deps need to be included (#3332)
  Bump RestEasy to 5.0.2 (#3329)

# Conflicts:
#	hapi-fhir-base/src/main/java/ca/uhn/fhir/i18n/Msg.java
#	hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseHapiFhirDao.java
#	hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/search/lastn/ElasticsearchSvcImpl.java
#	hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/dstu2/FhirResourceDaoDstu2SearchNoFtTest.java
#	hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/subscription/module/matcher/InMemorySubscriptionMatcherR4Test.java
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.

None yet

4 participants