File tree 1 file changed +9
-2
lines changed
1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -116,12 +116,19 @@ startPolling handleUpdate = go Nothing
116
116
go lastUpdateId = do
117
117
let inc (UpdateId n) = UpdateId (n + 1 )
118
118
offset = fmap inc lastUpdateId
119
- res <- try $ getUpdates (GetUpdatesRequest offset Nothing Nothing Nothing )
119
+ res <- try $
120
+ (Right <$> getUpdates
121
+ (GetUpdatesRequest offset Nothing Nothing Nothing ))
122
+ `catchError` (pure . Left )
123
+
120
124
nextUpdateId <- case res of
121
125
Left (ex :: SomeException ) -> do
122
126
liftIO (print ex)
123
127
pure lastUpdateId
124
- Right result -> do
128
+ Right (Left servantErr) -> do
129
+ liftIO (print servantErr)
130
+ pure lastUpdateId
131
+ Right (Right result) -> do
125
132
let updates = responseResult result
126
133
updateIds = map updateUpdateId updates
127
134
maxUpdateId = maximum (Nothing : map Just updateIds)
You can’t perform that action at this time.
0 commit comments