VKHS-1.9.1: Provides access to Vkontakte social network via public API

Safe HaskellNone
LanguageHaskell98

Web.VKHS.Error

Synopsis

Documentation

data Error Source #

Constructors

ETimeout 
EClient Error 

Instances

Eq Error Source # 

Methods

(==) :: Error -> Error -> Bool #

(/=) :: Error -> Error -> Bool #

Show Error Source # 

Methods

showsPrec :: Int -> Error -> ShowS #

show :: Error -> String #

showList :: [Error] -> ShowS #

data CallRecovery Source #

Message type used by the Superwiser to comminicatre with VK coroutine.

See apiR for usage example.

Constructors

ReExec MethodName MethodArgs

VK program is to re-execute the method with the given parameters

ReParse JSON

VK program is to re-parse the JSON as if it was the result of API call in question

type R t a = Result t a Source #

Alias for Result

data Result t a Source #

Result of VK monad execution. t represents the continuation monad, which needs to track two types: the early break t and the current result a. In order to be runnable (e.g. by runVK) both types are need to be the same.

  • FIXME re-implement the concept using Free library
  • FIMXE clean out of test/unused constructors

Constructors

Fine a

The normal exit of a computation

UnexpectedInt Error (Int -> t (R t a) (R t a))

Invalid integer value. It is possible for client to set a correct URL and continue

UnexpectedBool Error (Bool -> t (R t a) (R t a))

Invalid boolean value. It is possible for client to set a correct URL and continue

UnexpectedURL Error (URL -> t (R t a) (R t a))

Invalid URL. It is possible for client to set a correct URL and continue

UnexpectedRequest Error (Request -> t (R t a) (R t a)) 
UnexpectedResponse Error (Response -> t (R t a) (R t a)) 
UnexpectedFormField Form String (String -> t (R t a) (R t a)) 
LoginActionsExhausted 
RepeatedForm Form (() -> t (R t a) (R t a)) 
JSONParseFailure ByteString (JSON -> t (R t a) (R t a)) 
JSONParseFailure' JSON String 
JSONCovertionFailure (JSON, Text) (JSON -> t (R t a) (R t a))

Failed to convert JSON into Haskell object, Text describes an error. Superwiser may wish to replace the JSON with the correct one

LogError Text (() -> t (R t a) (R t a)) 
CallFailure (MethodName, MethodArgs, JSON, String) (CallRecovery -> t (R t a) (R t a)) 

Instances

MonadVK (t (R t x)) (R t x) => EnsureVK t (R t x) (Either Error URL) URL Source # 

Methods

ensure :: t (R t x) (Either Error URL) -> t (R t x) URL Source #

MonadVK (t (R t x)) (R t x) => EnsureVK t (R t x) (Either Error Request) Request Source # 

Methods

ensure :: t (R t x) (Either Error Request) -> t (R t x) Request Source #

describeResult :: Show a => Result t a -> Text Source #

A partial Show for Result class. Continuation parameters prevent it from be instance of standard Show.