CustomErrorResponse class

A complex type that controls:

  • Whether CloudFront replaces HTTP status codes in the 4xx and 5xx range with custom error messages before returning the response to the viewer.
  • How long CloudFront caches HTTP status codes in the 4xx and 5xx range.
For more information about custom error pages, see Customizing Error Responses in the Amazon CloudFront Developer Guide.

Constructors

CustomErrorResponse({required int errorCode, int? errorCachingMinTTL, String? responseCode, String? responsePagePath})
CustomErrorResponse.fromXml(XmlElement elem)
factory

Properties

errorCachingMinTTL int?
The minimum amount of time, in seconds, that you want CloudFront to cache the HTTP status code specified in ErrorCode. When this time period has elapsed, CloudFront queries your origin to see whether the problem that caused the error has been resolved and the requested object is now available.
final
errorCode int
The HTTP status code for which you want to specify a custom error page and/or a caching duration.
final
hashCode int
The hash code for this object.
no setterinherited
responseCode String?
The HTTP status code that you want CloudFront to return to the viewer along with the custom error page. There are a variety of reasons that you might want CloudFront to return a status code different from the status code that your origin returned to CloudFront, for example:
final
responsePagePath String?
The path to the custom error page that you want CloudFront to return to a viewer when your origin returns the HTTP status code specified by ErrorCode, for example, /4xx-errors/403-forbidden.html. If you want to store your objects and your custom error pages in different locations, your distribution must include a cache behavior for which the following is true:
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
toXml(String elemName, {List<XmlAttribute>? attributes}) → XmlElement

Operators

operator ==(Object other) bool
The equality operator.
inherited