Skip to content
This repository has been archived by the owner on Oct 21, 2022. It is now read-only.

Commit

Permalink
Test for error value from apply_recipe fallback. (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
BioTurboNick authored Aug 26, 2021
1 parent cd70617 commit 2cab220
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/plot_recipe.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,20 @@ function _process_plotrecipe(plt, kw, kw_list, still_to_process)
st = kw[:seriestype]
st = kw[:seriestype] = type_alias(plt, st)
datalist = RecipesBase.apply_recipe(kw, Val{st}, plt)
warn_on_recipe_aliases!(plt, datalist, :plot, st)
for data in datalist
preprocess_attributes!(plt, data.plotattributes)
if data.plotattributes[:seriestype] == st
error("Plot recipe $st returned the same seriestype: $(data.plotattributes)")
if !isnothing(datalist)
warn_on_recipe_aliases!(plt, datalist, :plot, st)
for data in datalist
preprocess_attributes!(plt, data.plotattributes)
if data.plotattributes[:seriestype] == st
error("Plot recipe $st returned the same seriestype: $(data.plotattributes)")
end
push!(still_to_process, data.plotattributes)
end
push!(still_to_process, data.plotattributes)
else
push!(kw_list, kw)
end
catch err
# the try/catch block can be removed when Plots.jl makes the compensating change
if err isa MethodError && occursin("plot recipe", err.args)
push!(kw_list, kw)
else
Expand Down

0 comments on commit 2cab220

Please sign in to comment.