cadCAD-org / cadCAD

Design, simulate, validate, and operate within complex systems
https://cadcad.org
MIT License
549 stars 271 forks source link

ValueError gives mis-leading error message if catching a non-related ValueError #257

Closed LinuxIsCool closed 3 years ago

LinuxIsCool commented 3 years ago

https://github.com/cadCAD-org/cadCAD/blob/7feecf85efcbfbcb40649e87cd0a8be1ac773a15/cadCAD/engine/execution.py#L147

My policy function was raising ValueError due to a mis-use of a numpy function which was raising a ValueError. The "\'sim_configs\' N must > 0" message was thus very confusing.

Suggestion: cadCAD should define it's own exceptions and raise them explicitly before having a final generic exception for cases like this. Cheers :cactus:

JEJodesty commented 3 years ago

@LinuxIsCool Thanks :) Will move sim_configs exception including this ValueError execution to the correct place

JEJodesty commented 3 years ago

Updated Build with solution in staging branch https://github.com/cadCAD-org/cadCAD/tree/staging

JEJodesty commented 3 years ago

Resolved by ver 0.4.27