Skip to content

Not working for exception thrown by library function without HasCallStack #13

@yaitskov

Description

@yaitskov

stack new trace

app/Main.hs:

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.yaml:

extra-deps:
- haskell-stack-trace-plugin-0.1.3.0@sha256:b7f05707849dda721ed466df769ca9a3fb41de996c9cea1e568af85687489362,2121

package.yaml:

dependencies:
- base >= 4.7 && < 5
- directory
- haskell-stack-trace-plugin >= 0.1.3.0

executables:
  stacktrace-plugin-exe:
    main:                Main.hs
    source-dirs:         app
    ghc-options:
    - -fplugin=StackTrace.Plugin
    - -threaded
    - -rtsopts
    - -with-rtsopts=-N

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions