ApiErrorBody

com.softinio.verdict4s.algebra.ApiErrorBody
See theApiErrorBody companion object
final case class ApiErrorBody(kind: Option[String], message: Option[String], field: Option[String], raw: Json)

A best-effort reading of an error response body.

The TypeSafe docs describe error statuses precisely but do not pin the shape of the JSON body, so this parse is deliberately total: every field is optional and raw always holds what actually arrived. A 422 carrying an envelope this version does not recognise must still surface as a Verdict4sError.Api with its body intact — turning it into a decoding failure would hide the very detail the caller needs.

Value parameters

field

the offending field, for validation failures

kind

a machine-readable error type, when the body names one

message

a human-readable description, when the body carries one

raw

the body exactly as received

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product