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

GraphQL - Better error messages formatting #3454

Merged
merged 11 commits into from
Dec 20, 2021

Conversation

Premwoik
Copy link
Contributor

@Premwoik Premwoik commented Dec 15, 2021

This PR addresses MIM-1569 and solves wrongly formatted messages returned to the user from the webserver.

Proposed changes include:

  • Unification of the error messages format.
  • Introducing more information to authorization errors.
  • Testing produced messages.
  • Adding a catch that should handle all unexpected internal errors.

@Premwoik Premwoik changed the base branch from master to feature/graphql December 15, 2021 07:51
@codecov
Copy link

codecov bot commented Dec 15, 2021

Codecov Report

Merging #3454 (6d971fe) into feature/graphql (f491972) will decrease coverage by 0.01%.
The diff coverage is 95.00%.

Impacted file tree graph

@@                 Coverage Diff                 @@
##           feature/graphql    #3454      +/-   ##
===================================================
- Coverage            80.84%   80.83%   -0.02%     
===================================================
  Files                  424      424              
  Lines                32529    32566      +37     
===================================================
+ Hits                 26298    26324      +26     
- Misses                6231     6242      +11     
Impacted Files Coverage Δ
...ngoose_graphql/mongoose_graphql_cowboy_handler.erl 92.00% <90.90%> (+1.58%) ⬆️
src/mongoose_graphql/mongoose_graphql_errors.erl 90.62% <96.55%> (+57.29%) ⬆️
src/mongoose_graphql.erl 91.11% <100.00%> (+0.63%) ⬆️
.../mongoose_graphql/mongoose_graphql_permissions.erl 90.47% <100.00%> (+0.73%) ⬆️
src/mod_roster_mnesia.erl 72.72% <0.00%> (-21.22%) ⬇️
src/mongoose_tcp_listener.erl 76.59% <0.00%> (-4.26%) ⬇️
src/global_distrib/mod_global_distrib_receiver.erl 81.11% <0.00%> (-3.34%) ⬇️
src/logger/mongoose_log_filter.erl 78.08% <0.00%> (-1.37%) ⬇️
src/rdbms/mongoose_rdbms.erl 61.75% <0.00%> (-1.20%) ⬇️
src/mod_muc.erl 74.77% <0.00%> (-0.91%) ⬇️
... and 10 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 c218659...6d971fe. Read the comment docs.

@mongoose-im

This comment has been minimized.

@mongoose-im

This comment has been minimized.

@mongoose-im

This comment has been minimized.

@mongoose-im

This comment has been minimized.

@mongoose-im

This comment has been minimized.

@mongoose-im

This comment has been minimized.

@mongoose-im

This comment has been minimized.

@Premwoik Premwoik marked this pull request as ready for review December 17, 2021 09:17
@mongoose-im

This comment has been minimized.

@mongoose-im

This comment has been minimized.

@mongoose-im

This comment has been minimized.

@mongoose-im

This comment has been minimized.

@mongoose-im

This comment has been minimized.

Copy link
Member

@chrzaszcz chrzaszcz left a comment

Choose a reason for hiding this comment

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

The code looks good, error handling looks improved. I think some possible GraphQL errors are not fully tested - only formatting is checked. I guess it's just difficult to actually trigger all errors by faulty queries?

big_tests/tests/graphql_SUITE.erl Show resolved Hide resolved
@mongoose-im

This comment has been minimized.

@mongoose-im

This comment has been minimized.

@mongoose-im

This comment has been minimized.

Copy link
Member

@chrzaszcz chrzaszcz left a comment

Choose a reason for hiding this comment

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

Looks good!

@chrzaszcz chrzaszcz merged commit 9887260 into feature/graphql Dec 20, 2021
@chrzaszcz chrzaszcz deleted the graphql/fix-error-messages branch December 20, 2021 15:32
@chrzaszcz chrzaszcz added this to the 6.0.0 milestone Dec 12, 2022
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