| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Codeforces.Response
Synopsis
- data ResponseError
- responseErrorMsg :: ResponseError -> ErrorLog
- getData :: FromJSON a => String -> Query -> IO (Either ResponseError a)
- getAuthorizedData :: FromJSON a => UserConfig -> String -> Query -> IO (Either ResponseError a)
Documentation
data ResponseError Source #
An error that could occur during the retrieval and inital parsing of data from the Codeforces API.
Constructors
| ApiFail String | Corresponds to a |
| JsonError JSONException | Wrapper around |
| HttpError HttpException | Wrapper around |
Instances
| Show ResponseError Source # | |
Defined in Codeforces.Response Methods showsPrec :: Int -> ResponseError -> ShowS # show :: ResponseError -> String # showList :: [ResponseError] -> ShowS # | |
responseErrorMsg :: ResponseError -> ErrorLog Source #
Converts a ResponseError to a friendly error message to display, and
details that can be logged separately.
getData :: FromJSON a => String -> Query -> IO (Either ResponseError a) Source #
getData path query is a general function for returning some result data
from the Codeforces API.
getAuthorizedData :: FromJSON a => UserConfig -> String -> Query -> IO (Either ResponseError a) Source #
getAuthorizedData config path query requests and returns some result
data that requires authorization.