Skip to content
Closed
Show file tree
Hide file tree
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 Jul 23, 2018
1265e0e
Adds an Aeson-related empty exception
mdimjasevic Jul 24, 2018
62a5c1f
Merge branch 'develop' of github.com:input-output-hk/log-classifier i…
mdimjasevic Jul 25, 2018
6591ffd
WIP: adds support for handling JSON parsing exceptions
mdimjasevic Jul 25, 2018
8b56390
WIP: Fixes some compilation errors wrt exceptions, introduces some new
mdimjasevic Jul 26, 2018
ec35aec
Resolves conflict after a merge
mdimjasevic Jul 27, 2018
b846064
Resolves a few compile errors by adding the MonadThrow constraint
mdimjasevic Jul 27, 2018
5ffc186
Fixes a few Maybe TicketInfo compilation errors
mdimjasevic Jul 27, 2018
404322c
Fixes remaining compilation errors (MonadCatch constraint)
mdimjasevic Jul 27, 2018
7845bcd
Minor polishing (data -> newtype)
mdimjasevic Jul 27, 2018
5f8c328
Resolves a few merge conflicts
mdimjasevic Jul 30, 2018
6c563ef
Merge branch 'develop' of github.com:input-output-hk/log-classifier i…
mdimjasevic Jul 31, 2018
3b0e885
Changes the type of hnlAddJsonBody
mdimjasevic Jul 31, 2018
835d4cc
Merge branch 'develop' of github.com:input-output-hk/log-classifier i…
mdimjasevic Aug 1, 2018
d6745be
WIP: Changed the type of the apiRequest function; doesn't compile at …
mdimjasevic Aug 1, 2018
d7cc048
WIP: Resolved a number of compile errors, but still some left
mdimjasevic Aug 1, 2018
d9526cf
WIP: exception handling
mdimjasevic Aug 2, 2018
35e7821
Merge branch 'develop' of github.com:input-output-hk/log-classifier i…
mdimjasevic Aug 3, 2018
0ab5f7b
Merge branch 'develop' of github.com:input-output-hk/log-classifier i…
mdimjasevic Aug 6, 2018
6ffb37e
WIP: replaces catch with catches
mdimjasevic Aug 6, 2018
24cbedd
WIP: adds parseUrlThrow instead of parseRequest
mdimjasevic Aug 6, 2018
16c9584
WIP: Some more progress with removing compilation errors
mdimjasevic Aug 6, 2018
8569110
WIP: Yet some more progress with removing compilation errors
mdimjasevic Aug 6, 2018
35c278b
WIP: Yet some more progress with removing compilation errors
mdimjasevic Aug 6, 2018
afcbd80
[TSD-85] - Additional imports require new cabal2nix.nix
Aug 6, 2018
c73bb57
WIP: almost compiles
mdimjasevic Aug 7, 2018
4862c0d
WIP: It finally compiles
mdimjasevic Aug 7, 2018
088f0b7
WIP: Changing Either String a to (MonadThrow m => m a)
mdimjasevic Aug 8, 2018
753c1fb
[TSD-85] - Began rewriting iteratePages to use MonadThrow etc
Aug 9, 2018
7f8fadc
[TSD-85] - Minor edits, still having some type errors
Aug 9, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions cabal2nix.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{ mkDerivation, aeson, array, attoparsec, base, bytestring
, containers, directory, generics-sop, hspec, http-conduit
, containers, directory, either, generics-sop, hspec, http-conduit
, monad-control, mtl, optparse-applicative, QuickCheck, reflection
, regex-tdfa, resource-pool, sqlite-simple, stdenv, text, time
, transformers-base, universum, unliftio, zip-archive
, regex-tdfa, resource-pool, safe-exceptions, sqlite-simple, stdenv
, text, time, transformers-base, universum, unliftio, zip-archive
}:
mkDerivation {
pname = "log-classifier";
Expand All @@ -11,10 +11,11 @@ mkDerivation {
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
aeson array attoparsec base bytestring containers directory
aeson array attoparsec base bytestring containers directory either
generics-sop http-conduit monad-control mtl optparse-applicative
QuickCheck reflection regex-tdfa resource-pool sqlite-simple text
time transformers-base universum unliftio zip-archive
QuickCheck reflection regex-tdfa resource-pool safe-exceptions
sqlite-simple text time transformers-base universum unliftio
zip-archive
];
executableHaskellDepends = [ base universum ];
testHaskellDepends = [
Expand Down
2 changes: 2 additions & 0 deletions log-classifier.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ library
, bytestring
, containers
, directory
, either
Copy link
Contributor

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.

, http-conduit
-- Effects & company
, mtl
Expand All @@ -56,6 +57,7 @@ library
, universum
, zip-archive
, QuickCheck
, safe-exceptions
-- Database backend
, sqlite-simple
, resource-pool
Expand Down
5 changes: 2 additions & 3 deletions src/DataSource/DB.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The 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
Expand Down Expand Up @@ -448,4 +448,3 @@ deleteAllData conn = do
deleteCommentAttachments conn
deleteTicketComments conn
deleteTickets conn

Loading