Change where exceptions are caught

This commit is contained in:
kojix2
2021-01-22 11:07:33 +09:00
parent 96d11f8d0e
commit c4a726fd08
3 changed files with 14 additions and 16 deletions

View File

@@ -39,19 +39,7 @@ module YouPlot
labels = series[x_col]
values = series[y_col].map(&:to_f)
end
begin
UnicodePlot.barplot(labels, values, **params.to_hc)
# UnicodePlot error:
# All values have to be positive. Negative bars are not supported.
rescue ArgumentError => e
if YouPlot.run_as_executable?
warn e.backtrace[0]
warn "\e[35m#{e}\e[0m"
exit 1
else
raise e
end
end
UnicodePlot.barplot(labels, values, **params.to_hc)
end
def histogram(data, params)