Fix wrong error message in #11919#11930
Fix wrong error message in #11919#11930davidleejy wants to merge 4 commits intomatplotlib:masterfrom
Conversation
…() are not hidden.
|
Seems reasonable, but I'm not sure about the test failure. |
|
The test case for You have to add a new entry in REGEXP for the exception text you are generating in that case. |
mcolors.to_rgba_array function (called in try...except block).|
Appreciate the advice. Amended failing test. Reasoning behind amendment: exceptions raised by called functions should be tested at the level of these called functions. For e.g., if an exception is expected from
Feel free to comment @afvincent if you're free :) |
|
Sorry this fell through the cracks. This needs a rebase, but I think the basic idea, at least, is good. |
|
Hello. I'm probably the thousandth person to see this nonsense error message:
Please support the PR! (sorry I can't right now) |
|
This was fixed in #13959. |
|
Case 1 was incorrect and is fixed on master now, by #17245. So I believe all 3 cases are now fixed. Sorry this got stuck @davidleejy, but I'm going to close this now as unneeded. |
PR Summary
Fixes issue #11919 .
This PR chains (appropriate) exceptions raised by
mcolors.to_rgba_array()to additional exceptions raised by its callerscatter(). Now, the exception raised bymcolors.to_rgba_array()is visible if color values are outside of 0 to 1 range.Prior to this PR, exceptions are not chained - see commit e3a8004. Exceptions raised by
mcolors.to_rgba_array()were suppressed by exceptions of its callerscatter().This PR applies exception chaining solely on
scatterfunction. Author is open to helping chain other exceptions.PEP 3134 advises on Exception Chaining. Example use: https://stackoverflow.com/questions/16414744/python-exception-chaining
Outcome
Case 1: color values outside 0 to 1 range
Case 2: color array is wrong shape
Case 3: color is 'jaune'
PR Checklist