src/packages/EmbedIO/HttpExceptionHandler.cs
/// <summary>
/// <para>Gets a <see cref="HttpExceptionHandlerCallback"/> that will serialize a HTTP exception's
/// <see cref="IHttpException.Message">Message</see> and <see cref="IHttpException.DataObject">DataObject</see> properties
/// and send them as a JSON response.</para>
/// <para>The response will be a JSON object with a <c>message</c> property and a <c>data</c> property.</para>
/// </summary>
/// <param name="serializerCallback">A <see cref="ResponseSerializerCallback"/> used to serialize data and send it to the client.</param>
/// <returns>A <see cref="HttpExceptionHandlerCallback"/>.</returns>
/// <exception cref="ArgumentNullException"><paramref name="serializerCallback"/> is <see langword="null"/>.</exception>
Gets a  that will serialize a HTTP exception's
MessageDataObjectThe response will be a JSON object with a messagedata
Gets a that will serialize a HTTP exception ' s MessageDataObjectThe response will be a JSON object with a messagedata
public static HttpExceptionHandlerCallback FullDataResponse(ResponseSerializerCallback serializerCallback)
        {
            Validate.NotNull(nameof(serializerCallback), serializerCallback);
            return (context, httpException) => serializerCallback(context, new
            {
                message = httpException.Message,
                data = httpException.DataObject,
            });
        }
public static HttpExceptionHandlerCallback FullDataResponse ( ResponseSerializerCallback serializerCallback ) { Validate . NotNull ( nameof ( serializerCallback ) , serializerCallback ) ; return ( context , httpException ) => serializerCallback ( context , new { message = httpException . Message , data = httpException . DataObject , } ) ; }
Gets a  that will serialize a HTTP exception's
MessageDataObjectThe response will be a JSON object with a messagedata
Gets a that will serialize a HTTP exception ' s MessageDataObjectThe response will be a JSON object with a messagedata
None
None
serializerCallback
ResponseSerializerCallback
A  used to serialize data and send it to the client.
A used to serialize data and send it to the client .