module Network.Wai.Utilities.Exception where
import Control.Exception
import Imports
displayExceptionNoBacktrace :: (Exception e) => e -> String
displayExceptionNoBacktrace :: forall e. Exception e => e -> String
displayExceptionNoBacktrace = String -> String
trim (String -> String) -> (e -> String) -> e -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. SomeException -> String
forall e. Exception e => e -> String
displayException (SomeException -> String) -> (e -> SomeException) -> e -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. e -> SomeException
forall e. Exception e => e -> SomeException
toException
where
trim :: String -> String
trim = ((Char -> Bool) -> String -> String
forall a. (a -> Bool) -> [a] -> [a]
dropWhileEnd Char -> Bool
isSpace) (String -> String) -> (String -> String) -> String -> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((Char -> Bool) -> String -> String
forall a. (a -> Bool) -> [a] -> [a]
dropWhile Char -> Bool
isSpace)