Skip to contents

mm_error_body() simply plucks the detail list from the response body, where Megamation's API includes informative error messages.

Usage

mm_error_body(resp)

Arguments

resp

An API response.

Value

A string from the detail index of a named list (the parsed response).

Examples

fake_mm_resp <- httr2::response_json(
  body = list(
    detail = "This is a fake detail/message from the API's response."
  )
)
megamation:::mm_error_body(fake_mm_resp)
#> [1] "This is a fake detail/message from the API's response."