melisgl / mgl-pax

Documentation system, browser, generator.
https://melisgl.github.io/mgl-pax-world/
MIT License
75 stars 13 forks source link

locate-error calls without parameters fails; this causes incorrect error messages. #33

Closed zellerin closed 1 year ago

zellerin commented 1 year ago

Locate-error function docstring suggests that format-and-args may be empty, and in some calls it is. However, destructuring-bind in document-documentable/with-document-context then fails.

Example:

(mgl-pax:defsection @test
    ()
  (foobar foobar))

(mgl-pax:document @test)

gives

Error while parsing arguments to DESTRUCTURING-BIND:
  too few elements in
    ()
  to satisfy lambda list
    (FORMAT-CONTROL &REST FORMAT-ARGS):
  at least 1 expected, but got 0

Simple fix: change in locate-error function

:message format-and-args

to

:message (or format-and-args '(""))

The error now reads correctly

Could not locate FOOBAR FOOBAR. 
  [While documenting (@TEST MGL-PAX:SECTION)]

Tested on current master.

melisgl commented 1 year ago

Thank you. Fixed in f7a6c51b.

zellerin commented 1 year ago

Thanks.