type ErrorInfo = {
Message : string
StackTrace : string
ExceptionType : string
}
let trySkipCustomErrors (resp:HttpResponse) =
resp.TrySkipIisCustomErrors <- true
resp
let errorHandler f req =
try
f req >> trySkipCustomErrors
with ex ->
let info = {
Message = ex.Message
StackTrace = ex.StackTrace
ExceptionType = (ex.GetType ()).FullName
}
internalServerError >> jsonResponse (JsonUtil.FromObj info) >> trySkipCustomErrors
こんな具合で
type ErrorInfo = {
Message : string
StackTrace : string
ExceptionType : string
}
let trySkipCustomErrors (resp:HttpResponse) =
resp.TrySkipIisCustomErrors <- true
resp
let errorHandler f req =
try
f req >> trySkipCustomErrors
with ex ->
let info = {
Message = ex.Message
StackTrace = ex.StackTrace
ExceptionType = (ex.GetType ()).FullName
}
internalServerError >> jsonResponse (JsonUtil.FromObj info) >> trySkipCustomErrors
こんな具合で