@private
@JavaName toString
showThrowable :: Throwable -> String
+ @private
+ @JavaName getMessage
+ getMessageThrowable :: Throwable -> String
+ @private
+ @JavaName getCause
+ getCauseThrowable :: Throwable -> Maybe Throwable
importJava "java.lang.Exception" where
data Exception
@private
instance Show Exception where
show = showException
+class Throwable e where
+ toThrowable :: e -> Throwable
+
+messageOfException :: Throwable e => e -> String
+messageOfException = getMessageThrowable . toThrowable
+
+causeOfException :: Throwable e => e -> Maybe Throwable
+causeOfException = getCauseThrowable . toThrowable
+
+instance Throwable Throwable where
+ toThrowable = id
+instance Throwable Exception where
+ toThrowable = Java.unsafeCoerce
+
"Prints the given value in the console."
@inline
print :: Show a => a -> <Proc> ()