Table of Contents

Class HttpResponseMiddlewareHelper

Namespace
Geotab.Checkmate.ObjectModel
Assembly
Geotab.Checkmate.ObjectModel.dll

Helper for common methods needed for building responses in response middleware

public static class HttpResponseMiddlewareHelper
Inheritance
HttpResponseMiddlewareHelper
Inherited Members

Methods

Get(int)

Gets the corresponding response message based on status code

public static string? Get(int code)

Parameters

code int

The response code

Returns

string

A cleansed response code message

GetErrorTypeAndMessage(Exception, bool)

Gets sanitized exception type and message.

public static (Type ErrorType, string ErrorMessage) GetErrorTypeAndMessage(Exception exception, bool returnException)

Parameters

exception Exception

The exception.

returnException bool

Always return the exception

Returns

(Type ErrorType, string ErrorMessage)

Exception type and message with special characters escaped and sensitive data removed.

IsSensitiveExceptionType(Type)

Checks if exception type suggests bearing of sensitive info.

public static bool IsSensitiveExceptionType(Type exceptionType)

Parameters

exceptionType Type

Exception type.

Returns

bool

True, if exception can carry sensitive information.