more friendly error when x,y shape mis-match
This commit is contained in:
parent
2ef13c19ea
commit
28e46a582a
@ -147,7 +147,21 @@ end
|
|||||||
|
|
||||||
function Base.display(::PlotsDisplay, plt::Plot)
|
function Base.display(::PlotsDisplay, plt::Plot)
|
||||||
prepare_output(plt)
|
prepare_output(plt)
|
||||||
|
|
||||||
|
try
|
||||||
_display(plt)
|
_display(plt)
|
||||||
|
catch err
|
||||||
|
# need to be careful not to supress other kinds of error
|
||||||
|
# could use a more general error 'teleporter'
|
||||||
|
# 1. handle when length(x) != size(y,1)
|
||||||
|
if err isa BoundsError && length(err.i)==1
|
||||||
|
ex_nrows = length(err.i[1])
|
||||||
|
actual_nrows = size(err.a)[1]
|
||||||
|
@warn "length(x) == $ex_nrows, but only sees $actual_nrows in the other inputs."
|
||||||
|
else
|
||||||
|
rethorw()
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
_do_plot_show(plt, showval::Bool) = showval && gui(plt)
|
_do_plot_show(plt, showval::Bool) = showval && gui(plt)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user