It takes advantage of constructor inheritance to reduce the amount of code.
I think the large exception inheritance hierarchy is unnatural in MATLAB, since you can't catch exception for a given type. However, we do have comprehensive tests for all these exceptions so some users could rely on this structure ... so I kept it.
This PR refactors local exceptions in MATLAB.
It takes advantage of constructor inheritance to reduce the amount of code.
I think the large exception inheritance hierarchy is unnatural in MATLAB, since you can't catch exception for a given type. However, we do have comprehensive tests for all these exceptions so some users could rely on this structure ... so I kept it.