codeforces-cli-0.1.0: Command line interface to interact with Codeforces.
Safe HaskellNone
LanguageHaskell2010

Codeforces.Response

Synopsis

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 ResponseFail from the Codeforces API with the fail comment.

JsonError JSONException

Wrapper around JSONException, used if the successful JSON response could not be parsed.

HttpError HttpException

Wrapper around HttpException, used for situations like a failed connection.

Instances

Instances details
Show ResponseError Source # 
Instance details

Defined in Codeforces.Response

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.