-
Notifications
You must be signed in to change notification settings - Fork 3
[WIP] [TSD-85] Add exception handling for parsing HTTP requests #37
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
Closed
Closed
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
8b34ad2
[TSD-71] Generalize HTTP functions to a layer.
ksaric 1265e0e
Adds an Aeson-related empty exception
mdimjasevic 62a5c1f
Merge branch 'develop' of github.com:input-output-hk/log-classifier i…
mdimjasevic 6591ffd
WIP: adds support for handling JSON parsing exceptions
mdimjasevic 8b56390
WIP: Fixes some compilation errors wrt exceptions, introduces some new
mdimjasevic ec35aec
Resolves conflict after a merge
mdimjasevic b846064
Resolves a few compile errors by adding the MonadThrow constraint
mdimjasevic 5ffc186
Fixes a few Maybe TicketInfo compilation errors
mdimjasevic 404322c
Fixes remaining compilation errors (MonadCatch constraint)
mdimjasevic 7845bcd
Minor polishing (data -> newtype)
mdimjasevic 5f8c328
Resolves a few merge conflicts
mdimjasevic 6c563ef
Merge branch 'develop' of github.com:input-output-hk/log-classifier i…
mdimjasevic 3b0e885
Changes the type of hnlAddJsonBody
mdimjasevic 835d4cc
Merge branch 'develop' of github.com:input-output-hk/log-classifier i…
mdimjasevic d6745be
WIP: Changed the type of the apiRequest function; doesn't compile at …
mdimjasevic d7cc048
WIP: Resolved a number of compile errors, but still some left
mdimjasevic d9526cf
WIP: exception handling
mdimjasevic 35e7821
Merge branch 'develop' of github.com:input-output-hk/log-classifier i…
mdimjasevic 0ab5f7b
Merge branch 'develop' of github.com:input-output-hk/log-classifier i…
mdimjasevic 6ffb37e
WIP: replaces catch with catches
mdimjasevic 24cbedd
WIP: adds parseUrlThrow instead of parseRequest
mdimjasevic 16c9584
WIP: Some more progress with removing compilation errors
mdimjasevic 8569110
WIP: Yet some more progress with removing compilation errors
mdimjasevic 35c278b
WIP: Yet some more progress with removing compilation errors
mdimjasevic afcbd80
[TSD-85] - Additional imports require new cabal2nix.nix
c73bb57
WIP: almost compiles
mdimjasevic 4862c0d
WIP: It finally compiles
mdimjasevic 088f0b7
WIP: Changing Either String a to (MonadThrow m => m a)
mdimjasevic 753c1fb
[TSD-85] - Began rewriting iteratePages to use MonadThrow etc
7f8fadc
[TSD-85] - Minor edits, still having some type errors
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -113,7 +113,7 @@ emptyDBLayer = DBLayer | |
|
|
||
| -- | The simple connection Zendesk layer. Used for database querying. | ||
| -- We need to sync occasionaly. | ||
| connDataLayer :: forall m. (MonadIO m, MonadReader Config m) => DataLayer m | ||
| connDataLayer :: forall m. (MonadIO m, MonadReader Config m, MonadCatch m) => DataLayer m | ||
| connDataLayer = DataLayer | ||
| { zlGetTicketInfo = \tId -> withProdDatabase $ \conn -> getTicketInfoByTicketId conn tId | ||
| , zlListDeletedTickets = zlListDeletedTickets basicDataLayer | ||
|
|
@@ -147,7 +147,7 @@ connDBLayer = DBLayer | |
|
|
||
| -- | The connection pooled Zendesk layer. Used for database querying. | ||
| -- We need to sync occasionaly. | ||
| connPoolDataLayer :: forall m. (MonadBaseControl IO m, MonadIO m, MonadReader Config m) => DBConnPool -> DataLayer m | ||
| connPoolDataLayer :: forall m. (MonadBaseControl IO m, MonadIO m, MonadReader Config m, MonadCatch m) => DBConnPool -> DataLayer m | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is that constraint here? |
||
| connPoolDataLayer connPool = DataLayer | ||
| { zlGetTicketInfo = \tId -> withConnPool connPool $ \conn -> getTicketInfoByTicketId conn tId | ||
| , zlListDeletedTickets = zlListDeletedTickets basicDataLayer | ||
|
|
@@ -448,4 +448,3 @@ deleteAllData conn = do | |
| deleteCommentAttachments conn | ||
| deleteTicketComments conn | ||
| deleteTickets conn | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You really don't need this. Try it without.