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

Enhanced ApplicationsInventoryExceptionMapper to work with Quarkus 1.13.0 #22

Merged
merged 5 commits into from
Apr 13, 2021

Conversation

mrizzi
Copy link
Contributor

@mrizzi mrizzi commented Apr 2, 2021

resolve #21

Quarkus 1.13.0 introduced RestDataPanacheExceptionMapper for wrapping REST Data Panache exceptions RestDataPanacheException (quarkusio/quarkus#15278).

We already had an ExceptionMapper (ResourcesExceptionHandler) that was not able to fire anymore because the exceptions from REST Data Panache methods became RestDataPanacheException and not WebApplicationException anymore.

So this PR :

  • adds ApplicationsInventoryException to be used for throwing exceptions from application's code
  • adds ApplicationsInventoryExceptionMapper for managing RestDataPanacheException with this approach:
    • if the exception's cause is an ApplicationsInventoryException, it manages it
    • otherwise it leverages the provided RestDataPanacheExceptionMapper (with the specific testAddBadPayload test for this case)
  • changed ApplicationsDependency accordingly to the changes above

Further changes from quarkusio/quarkus#16294

@codecov
Copy link

codecov bot commented Apr 2, 2021

Codecov Report

Merging #22 (a795e06) into main (4609b15) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##                main       #22   +/-   ##
===========================================
  Coverage     100.00%   100.00%           
- Complexity        25        28    +3     
===========================================
  Files              5         6    +1     
  Lines             41        48    +7     
  Branches           5         5           
===========================================
+ Hits              41        48    +7     
Impacted Files Coverage Δ Complexity Δ
...tioninventory/entities/ApplicationsDependency.java 100.00% <100.00%> (ø) 10.00 <7.00> (ø)
...ory/exceptions/ApplicationsInventoryException.java 100.00% <100.00%> (ø) 1.00 <1.00> (?)
...ceptions/ApplicationsInventoryExceptionMapper.java 100.00% <100.00%> (ø) 4.00 <4.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 4609b15...a795e06. Read the comment docs.

Copy link
Contributor

@m-brophy m-brophy left a comment

Choose a reason for hiding this comment

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

Unused imports should be removed - ApplicationsDependency.java lines 23-25

@mrizzi mrizzi requested a review from m-brophy April 7, 2021 13:29
@mrizzi
Copy link
Contributor Author

mrizzi commented Apr 9, 2021

Considering 9ad6533 works and that Quarkus 1.13.1 has been released in the meantime, I'll keep this PR with a further commit to bump the version to be the latest available.

@m-brophy m-brophy merged commit 5416089 into migtools:main Apr 13, 2021
@mrizzi mrizzi deleted the bump-quarkus-1.13.0 branch April 13, 2021 16:49
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.

Bump version to Quarkus 1.13.0 requires fixes
2 participants