Move RestError declaration to common. (#7)
This commit is contained in:
parent
db39cdcdc7
commit
37b25eaf2c
|
@ -42,19 +42,6 @@ type
|
|||
RestReturnKind {.pure.} = enum
|
||||
Status, PlainResponse, GenericResponse, Value
|
||||
|
||||
RestDefect* = object of Defect
|
||||
RestError* = object of CatchableError
|
||||
RestEncodingError* = object of RestError
|
||||
field*: cstring
|
||||
RestDecodingError* = object of RestError
|
||||
RestCommunicationError* = object of RestError
|
||||
exc*: ref HttpError
|
||||
RestRedirectionError* = object of RestError
|
||||
RestResponseError* = object of RestError
|
||||
status*: int
|
||||
contentType*: string
|
||||
message*: string
|
||||
|
||||
const
|
||||
RestContentTypeArg = "restContentType"
|
||||
RestAcceptTypeArg = "restAcceptType"
|
||||
|
|
|
@ -42,6 +42,20 @@ type
|
|||
|
||||
ByteChar* = string | seq[byte]
|
||||
|
||||
RestDefect* = object of Defect
|
||||
RestError* = object of CatchableError
|
||||
RestBadRequestError* = object of RestError
|
||||
RestEncodingError* = object of RestError
|
||||
field*: cstring
|
||||
RestDecodingError* = object of RestError
|
||||
RestCommunicationError* = object of RestError
|
||||
exc*: ref HttpError
|
||||
RestRedirectionError* = object of RestError
|
||||
RestResponseError* = object of RestError
|
||||
status*: int
|
||||
contentType*: string
|
||||
message*: string
|
||||
|
||||
proc error*(t: typedesc[RestApiResponse],
|
||||
status: HttpCode = Http200, msg: string = "",
|
||||
contentType: string = "text/html"): RestApiResponse =
|
||||
|
|
|
@ -32,6 +32,3 @@ chronicles.expandIt(RestApiError):
|
|||
type
|
||||
RestServerState* {.pure.} = enum
|
||||
Closed, Stopped, Running
|
||||
|
||||
RestError* = object of CatchableError
|
||||
RestBadRequestError* = object of RestError
|
||||
|
|
Loading…
Reference in New Issue