Hi,
I defined an object with metaclass dao-class but forgot to add any col- type options, this results in a rather cryptic error that is hard to get out of in LispWorks:
P1 10 > (select-dao 'enumeration)
Error: The assertion (= (LENGTH POSTMODERN::QUERY-FIELDS) POSTMODERN::N-DAO-FIELDS) failed. 1 (continue) Retry assertion. 2 (abort) Return to level 0. 3 Return to top loop level 0.
Type :b for backtrace, :c <option number> to proceed, or :? for other options
P1 11 : 1 > :bq
(HARLEQUIN-COMMON-LISP:SUBFUNCTION 1 POSTMODERN::BUILD-ROW-READER) <- CL-POSTGRES::SEND-QUERY <- (HARLEQUIN-COMMON-LISP:SUBFUNCTION (LABELS #:G244377) CL- POSTGRES:EXEC-QUERY) <- CL-POSTGRES:EXEC-QUERY <- LET <- EVAL <- CAPI::CAPI-TOP-LEVEL-FUNCTION <- CAPI::INTERACTIVE-PANE-TOP- LOOP <- (HARLEQUIN-COMMON-LISP:SUBFUNCTION MP::PROCESS-SG-FUNCTION MP::INITIALIZE-PROCESS-STACK)
I can live with this, but maybe it would be good to make this more user friendly.
Cheers,
Sven
Good point. This and similar table-does-not-match-class errors are bound to come up a lot, so I've added some more helpful error messages.
Cheers, Marijn
I defined an object with metaclass dao-class but forgot to add any col-type options, this results in a rather cryptic error that is hard to get out of in LispWorks:
P1 10 > (select-dao 'enumeration)
Error: The assertion (= (LENGTH POSTMODERN::QUERY-FIELDS) POSTMODERN::N-DAO-FIELDS) failed. 1 (continue) Retry assertion. 2 (abort) Return to level 0. 3 Return to top loop level 0.
Type :b for backtrace, :c <option number> to proceed, or :? for other options
P1 11 : 1 > :bq
(HARLEQUIN-COMMON-LISP:SUBFUNCTION 1 POSTMODERN::BUILD-ROW-READER) <- CL-POSTGRES::SEND-QUERY <- (HARLEQUIN-COMMON-LISP:SUBFUNCTION (LABELS #:G244377) CL-POSTGRES:EXEC-QUERY) <- CL-POSTGRES:EXEC-QUERY <- LET <- EVAL <- CAPI::CAPI-TOP-LEVEL-FUNCTION <- CAPI::INTERACTIVE-PANE-TOP-LOOP <- (HARLEQUIN-COMMON-LISP:SUBFUNCTION MP::PROCESS-SG-FUNCTION MP::INITIALIZE-PROCESS-STACK)
I can live with this, but maybe it would be good to make this more user friendly.
Cheers,
Sven _______________________________________________ postmodern-devel mailing list postmodern-devel@common-lisp.net http://common-lisp.net/cgi-bin/mailman/listinfo/postmodern-devel
On 19 Apr 2008, at 19:29, Marijn Haverbeke wrote:
Good point. This and similar table-does-not-match-class errors are bound to come up a lot, so I've added some more helpful error messages.
Thanks, did you also handle the case of using get-dao when there are no keys defined ? I believe that got into a loop... There might be others too, but the more I get things right, the less absolute beginner errors that I make ;-)
Sven
Hi Sven,
Thanks, did you also handle the case of using get-dao when there are no keys defined ? I believe that got into a loop...
It did -- though some rather bizarre corner case. I've pushed a fix to raise an error instead -- calling get-dao on key-less classes is not allowed.
Regards, Marijn
Hi Marijn,
On 21 Apr 2008, at 15:15, Marijn Haverbeke wrote:
Hi Sven,
Thanks, did you also handle the case of using get-dao when there are no keys defined ? I believe that got into a loop...
It did -- though some rather bizarre corner case. I've pushed a fix to raise an error instead -- calling get-dao on key-less classes is not allowed.
Regards, Marijn
I know, catching these newbie errors is not the real stuff. I now get:
P1 24 > (defclass foo () ()) #<STANDARD-CLASS FOO 21F6D767>
P1 25 > (get-dao 'foo)
Error: Class FOO has no key slots. 1 (abort) Return to level 0. 2 Return to top loop level 0.
Type :b for backtrace, :c <option number> to proceed, or :? for other options
This is certainly correct and better than a loop. However, in the above transcript I even forgot to declare the proper meta class, maybe that should be the first error being reported. I know I am being annoying, but I am only trying to help; I promise I will never repeat this suggestion. Next time, I'll hopefully have a better request.
Sven
postmodern-devel@common-lisp.net