setError()

Overview

public any function setError(
      string  type           = "rest.server.error"
    , string  title          = "Server error"
    , numeric errorCode      = 500
    , string  message        = "An unhandled exception occurred within the REST API"
    , string  detail         = ""
    , struct  additionalInfo
)

Sets data, statuses and headers based on common arguments for errors

Arguments

NameTypeRequiredDescription
typestringNo (default="rest.server.error")
titlestringNo (default="Server error")
errorCodenumericNo (default=500)
messagestringNo (default="An unhandled exception occurred within the REST API")
detailstringNo (default="")
additionalInfostructNo