Stack trace in error message does not show locations in .pm files #255

Closed
opened 4 years ago by bluebear94 · 2 comments
bluebear94 commented 4 years ago (Migrated from github.com)

For example, you might get the following error message:

nc: arity mismatch;
 the expected number of arguments does not match the given number
  expected: 1
  given: 2

  context...:
   body of (submod "/home/kozet/ncv9/src/grammar/nouns.html.pm" pollen-module)
   /home/kozet/.local/share/racket/8.1/pkgs/pollen/pollen/private/cache-utils.rkt:67:0: path->hash
   /home/kozet/.local/share/racket/8.1/pkgs/pollen/pollen/private/cache-utils.rkt:124:2: generate-dest-file
   /usr/share/racket/collects/file/cache.rkt:63:2: fetch-and-continue
   /usr/share/racket/collects/racket/contract/private/arrow-val-first.rkt:555:3
   /home/kozet/.local/share/racket/8.1/pkgs/pollen/pollen/private/cache-utils.rkt:114:0: cache-ref!
   /usr/share/racket/collects/racket/private/more-scheme.rkt:377:2: hash-ref!
   /home/kozet/.local/share/racket/8.1/pkgs/pollen/pollen/cache.rkt:39:4: cached-require-base
   body of 'g43165
   /home/kozet/.local/share/racket/8.1/pkgs/pollen/pollen/render.rkt:386:0: render-markup-or-markdown-source
   /home/kozet/.local/share/racket/8.1/pkgs/pollen/pollen/render.rkt:312:25: render
   /home/kozet/.local/share/racket/8.1/pkgs/pollen/pollen/private/cache-utils.rkt:124:2: generate-dest-file
   /usr/share/racket/collects/file/cache.rkt:63:2: fetch-and-continue
   /usr/share/racket/collects/racket/contract/private/arrow-val-first.rkt:555:3
   /home/kozet/.local/share/racket/8.1/pkgs/pollen/pollen/private/cache-utils.rkt:114:0: cache-ref!
   /usr/share/racket/collects/racket/private/more-scheme.rkt:377:2: hash-ref!
   ...
pollen: /error.css 

where you don't get any information on where in nouns.html.pm the error is.

For example, you might get the following error message: ``` nc: arity mismatch; the expected number of arguments does not match the given number expected: 1 given: 2 context...: body of (submod "/home/kozet/ncv9/src/grammar/nouns.html.pm" pollen-module) /home/kozet/.local/share/racket/8.1/pkgs/pollen/pollen/private/cache-utils.rkt:67:0: path->hash /home/kozet/.local/share/racket/8.1/pkgs/pollen/pollen/private/cache-utils.rkt:124:2: generate-dest-file /usr/share/racket/collects/file/cache.rkt:63:2: fetch-and-continue /usr/share/racket/collects/racket/contract/private/arrow-val-first.rkt:555:3 /home/kozet/.local/share/racket/8.1/pkgs/pollen/pollen/private/cache-utils.rkt:114:0: cache-ref! /usr/share/racket/collects/racket/private/more-scheme.rkt:377:2: hash-ref! /home/kozet/.local/share/racket/8.1/pkgs/pollen/pollen/cache.rkt:39:4: cached-require-base body of 'g43165 /home/kozet/.local/share/racket/8.1/pkgs/pollen/pollen/render.rkt:386:0: render-markup-or-markdown-source /home/kozet/.local/share/racket/8.1/pkgs/pollen/pollen/render.rkt:312:25: render /home/kozet/.local/share/racket/8.1/pkgs/pollen/pollen/private/cache-utils.rkt:124:2: generate-dest-file /usr/share/racket/collects/file/cache.rkt:63:2: fetch-and-continue /usr/share/racket/collects/racket/contract/private/arrow-val-first.rkt:555:3 /home/kozet/.local/share/racket/8.1/pkgs/pollen/pollen/private/cache-utils.rkt:114:0: cache-ref! /usr/share/racket/collects/racket/private/more-scheme.rkt:377:2: hash-ref! ... pollen: /error.css ``` where you don't get any information on where in `nouns.html.pm` the error is.
mbutterick commented 4 years ago (Migrated from github.com)

AFAIK that’s just the way errors are reported when they arise from modules that are synthesized at compile time. For instance, this source:

#lang scribble/manual

@(error 'boom)

Produces this error:

error: boom
  context...:
   body of "path/to/foo.scrbl"
AFAIK that’s just the way errors are reported when they arise from modules that are synthesized at compile time. For instance, this source: ``` #lang scribble/manual @(error 'boom) ``` Produces this error: ``` error: boom context...: body of "path/to/foo.scrbl" ```
sorawee commented 4 years ago (Migrated from github.com)

FWIW, errortrace can work with Pollen programs. Given:

#lang pollen

Hello ◊(/ 1 0) world

Running racket test.html.pm results in:

/: division by zero
  context...:
   body of (submod "/Users/sorawee/test.html.pm" pollen-module)

But running racket -l errortrace -t test.html.pm results in:

/: division by zero
  errortrace...:
   /Users/sorawee/test.html.pm:3:7: (/ 1 0)
  context...:
   body of (submod "/Users/sorawee/test.html.pm" pollen-module)
FWIW, [errortrace](https://docs.racket-lang.org/errortrace/index.html) can work with Pollen programs. Given: ``` #lang pollen Hello ◊(/ 1 0) world ``` Running `racket test.html.pm` results in: ``` /: division by zero context...: body of (submod "/Users/sorawee/test.html.pm" pollen-module) ``` But running `racket -l errortrace -t test.html.pm` results in: ``` /: division by zero errortrace...: /Users/sorawee/test.html.pm:3:7: (/ 1 0) context...: body of (submod "/Users/sorawee/test.html.pm" pollen-module) ```
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mbutterick/pollen#255
Loading…
There is no content yet.