You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Not working for exception thrown by library function without HasCallStack #13
module Main where
-- import GHC.Stack
import System.Directory
import Data.Maybe (fromJust)
main :: IO ()
main = do
myDo "/z"
print f1
myDo x = do
getDirectoryContents x
stack run
...
Installing executable stacktrace-plugin-exe in /home/dan/demo/haskell/cabal/stacktrace-plugin/.stack-work/install/x86_64-linux-tinfo6/a312ec7a31d449d77cf93f7d5c4fe35cdb919b67bfa2faa8f121cda8cb898c28/8.10.7/bin
Registering library for stacktrace-plugin-0.1.0.0..
stacktrace-plugin-exe: /z: getDirectoryContents:openDirStream: does not exist (No such file or directory)
No stack trace - just regular exception message in console.
Running the demo with lazy functions is working for the same configuration.
The problem is about building dependencies with this plugin too. Same for head [].
I would replace problematic base functions such as head with tracing wrappers:
traceableHead :: HasStackTrace => [a] -> a
traceableHead l@(a:_) = Prelude.head l
traceableHead _ = error $ "head of empty list"
changed the title [-]Not working for exception thrown by function without HasCallStack[/-][+]Not working for exception thrown by library function without HasCallStack[/+]on Dec 13, 2021
Activity
[-]Not working for IO function[/-][+]Not working for exception thrown by function without HasCallStack[/+]yaitskov commentedon Dec 13, 2021
The problem is about building dependencies with this plugin too. Same for
head [].I would replace problematic base functions such as head with tracing wrappers:
[-]Not working for exception thrown by function without HasCallStack[/-][+]Not working for exception thrown by library function without HasCallStack[/+]