func (e HttpError) Write() ([]byte, error) {
	errorConf := getErrorConfig()

	switch errorConf.errorType {
	case ErrorTypeMarkup:
		out, err := view.RenderTemplate(errorConf.templateRaw, e)
		if err != nil {
			return nil, err
		}
		return []byte(out), nil

	case ErrorTypeMarkupWithLayout:
		out, err := errorConf.templateWithLayout.Render(e)
		if err != nil {
			return nil, err
		}
		return []byte(out), nil

	case ErrorTypeJSON:
		out, err := json.Marshal(e)
		if err != nil {
			return nil, err
		}
		return out, nil

	default:
		return []byte(fmt.Sprintf("%d %s", e.Status, e.Message)), nil
	}
}
// Write returns a string representation of the error based on the global configuration. In case of failure, an error is returned
Write returns a string representation of the error based on the global configuration. In case of failure, an error is returned
// Write returns a string representation of the error based on the global configuration . In case of failure an error is returned
func (e HttpError) Write() ([]byte, error) {
	errorConf := getErrorConfig()
	switch errorConf.errorType {
	case ErrorTypeMarkup:
		out, err := view.RenderTemplate(errorConf.templateRaw, e)
		if err != nil {
			return nil, err
		}
		return []byte(out), nil
	case ErrorTypeMarkupWithLayout:
		out, err := errorConf.templateWithLayout.Render(e)
		if err != nil {
			return nil, err
		}
		return []byte(out), nil
	case ErrorTypeJSON:
		out, err := json.Marshal(e)
		if err != nil {
			return nil, err
		}
		return out, nil
	default:
		return []byte(fmt.Sprintf("%d %s", e.Status, e.Message)), nil
	}
}
func ( e HttpError ) Write ( ) ( [ ] byte , error ) { errorConf := getErrorConfig ( ) switch errorConf . errorType { case ErrorTypeMarkup : out , err := view . RenderTemplate ( errorConf . templateRaw , e ) if err != nil { return nil , err } return [ ] byte ( out ) , nil case ErrorTypeMarkupWithLayout : out , err := errorConf . templateWithLayout . Render ( e ) if err != nil { return nil , err } return [ ] byte ( out ) , nil case ErrorTypeJSON : out , err := json . Marshal ( e ) if err != nil { return nil , err } return out , nil default : return [ ] byte ( fmt . Sprintf ( " " , e . Status , e . Message ) ) , nil } }
Write returns a string representation of the error based on the global configuration.
Write returns a string representation of the error based on the global configuration .