func (client *Datetimerfc1123Client) getOverflowHandleError(resp *http.Response) error {
	body, err := runtime.Payload(resp)
	if err != nil {
		return runtime.NewResponseError(err, resp)
	}
	errType := Error{raw: string(body)}
	if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil {
		return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp)
	}
	return runtime.NewResponseError(&errType, resp)
}
getOverflowHandleError handles the GetOverflow error response.
package datetimerfc1123group
import (
	"context"
	"fmt"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore/policy"
	"github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime"
	"net/http"
	"time"
)
type Datetimerfc1123Client struct {
	con *Connection
}
func NewDatetimerfc1123Client(con *Connection) *Datetimerfc1123Client {
	return &Datetimerfc1123Client{con: con}
}
func (client *Datetimerfc1123Client) GetInvalid(ctx context.Context, options *Datetimerfc1123GetInvalidOptions) (Datetimerfc1123GetInvalidResponse, error) {
	req, err := client.getInvalidCreateRequest(ctx, options)
	if err != nil {
		return Datetimerfc1123GetInvalidResponse{}, err
	}
	resp, err := client.con.Pipeline().Do(req)
	if err != nil {
		return Datetimerfc1123GetInvalidResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return Datetimerfc1123GetInvalidResponse{}, client.getInvalidHandleError(resp)
	}
	return client.getInvalidHandleResponse(resp)
}
func (client *Datetimerfc1123Client) getInvalidCreateRequest(ctx context.Context, options *Datetimerfc1123GetInvalidOptions) (*policy.Request, error) {
	urlPath := "/datetimerfc1123/invalid"
	req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.con.Endpoint(), urlPath))
	if err != nil {
		return nil, err
	}
	req.Raw().Header.Set("Accept", "application/json")
	return req, nil
}
func (client *Datetimerfc1123Client) getInvalidHandleResponse(resp *http.Response) (Datetimerfc1123GetInvalidResponse, error) {
	result := Datetimerfc1123GetInvalidResponse{RawResponse: resp}
	var aux *timeRFC1123
	if err := runtime.UnmarshalAsJSON(resp, &aux); err != nil {
		return Datetimerfc1123GetInvalidResponse{}, runtime.NewResponseError(err, resp)
	}
	result.Value = (*time.Time)(aux)
	return result, nil
}
func (client *Datetimerfc1123Client) getInvalidHandleError(resp *http.Response) error {
	body, err := runtime.Payload(resp)
	if err != nil {
		return runtime.NewResponseError(err, resp)
	}
	errType := Error{raw: string(body)}
	if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil {
		return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp)
	}
	return runtime.NewResponseError(&errType, resp)
}
func (client *Datetimerfc1123Client) GetNull(ctx context.Context, options *Datetimerfc1123GetNullOptions) (Datetimerfc1123GetNullResponse, error) {
	req, err := client.getNullCreateRequest(ctx, options)
	if err != nil {
		return Datetimerfc1123GetNullResponse{}, err
	}
	resp, err := client.con.Pipeline().Do(req)
	if err != nil {
		return Datetimerfc1123GetNullResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return Datetimerfc1123GetNullResponse{}, client.getNullHandleError(resp)
	}
	return client.getNullHandleResponse(resp)
}
func (client *Datetimerfc1123Client) getNullCreateRequest(ctx context.Context, options *Datetimerfc1123GetNullOptions) (*policy.Request, error) {
	urlPath := "/datetimerfc1123/null"
	req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.con.Endpoint(), urlPath))
	if err != nil {
		return nil, err
	}
	req.Raw().Header.Set("Accept", "application/json")
	return req, nil
}
func (client *Datetimerfc1123Client) getNullHandleResponse(resp *http.Response) (Datetimerfc1123GetNullResponse, error) {
	result := Datetimerfc1123GetNullResponse{RawResponse: resp}
	var aux *timeRFC1123
	if err := runtime.UnmarshalAsJSON(resp, &aux); err != nil {
		return Datetimerfc1123GetNullResponse{}, runtime.NewResponseError(err, resp)
	}
	result.Value = (*time.Time)(aux)
	return result, nil
}
func (client *Datetimerfc1123Client) getNullHandleError(resp *http.Response) error {
	body, err := runtime.Payload(resp)
	if err != nil {
		return runtime.NewResponseError(err, resp)
	}
	errType := Error{raw: string(body)}
	if err := runtime.UnmarshalAsJSON(resp, &errType); err != nil {
		return runtime.NewResponseError(fmt.Errorf("%s\n%s", string(body), err), resp)
	}
	return runtime.NewResponseError(&errType, resp)
}
func (client *Datetimerfc1123Client) GetOverflow(ctx context.Context, options *Datetimerfc1123GetOverflowOptions) (Datetimerfc1123GetOverflowResponse, error) {
	req, err := client.getOverflowCreateRequest(ctx, options)
	if err != nil {
		return Datetimerfc1123GetOverflowResponse{}, err
	}
	resp, err := client.con.Pipeline().Do(req)
	if err != nil {
		return Datetimerfc1123GetOverflowResponse{}, err
	}
	if !runtime.HasStatusCode(resp, http.StatusOK) {
		return Datetimerfc1123GetOverflowResponse{}, client.getOverflowHandleError(resp)
	}
	return client.getOverflowHandleResponse(resp)
}
func (client *Datetimerfc1123Client) getOverflowCreateRequest(ctx context.Context, options *Datetimerfc1123GetOverflowOptions) (*policy.Request, error) {
	urlPath := "/datetimerfc1123/overflow"
	req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.con.Endpoint(), urlPath))
	if err != nil {
		return nil, err
	}
	req.Raw().Header.Set("Accept", "application/json")
	return req, nil
}
func (client *Datetimerfc1123Client) getOverflowHandleResponse(resp *http.Response) (Datetimerfc1123GetOverflowResponse, error) {
	result := Datetimerfc1123GetOverflowResponse{RawResponse: resp}
	var aux *timeRFC1123
	if err := runtime.UnmarshalAsJSON(resp, &aux); err != nil {
		return Datetimerfc1123GetOverflowResponse{}, runtime.NewResponseError(err, resp)
	}
	result.Value = (*time.Time)(aux)
	return result, nil
}