refact(zopeutil): Made error msg more descriptive#486
Conversation
added helper function for upfront syntax check to addExternalMethod Co-authored-by: Copilot <copilot@github.com>
Code-Errors in Meta-CmdsFollowing this approach I tried to fit error messages of meta-cmds as well: it is tricky, because ExtMethod (in contrast to PyScript or ZPT) dont provide syntax validation by Zope. Until now a wrong py-syntax (e.g. import of not-installed module) just broke saving and thus the Zope object (the pointer to the external method) was not deleted - by chance. If the code was once broken, you could not repair it via ZMI. Lines 259 to 282 in 0a8b3ef
|
|
@drfho Now I'm missing the hint from the thrown exception that I introduced earlier to locate the problem in the code - but maybe the general error message will be sufficient |
|
BTW. For |


This PR tries to improve the feedback in ZMI if errors occur in custom code. It replaces the internal representation
<Products.zms.zopeutil.MissingArtefactProxy object at 0x113a57890>by a more descriptive error messages for brokenExternalMethodsinZMSMetaobjManager.I cannot fully assess the impact of changing the
try/except-handlinginzopeutil, as I do not understand the previous changes referenced below. Furthermore, otherZMS*ManagerswithExternalMethodsupport may affected and must be addressed.References: