mirror of
https://github.com/red-data-tools/YouPlot.git
synced 2025-05-05 22:31:11 +08:00
Friendly error messages
This commit is contained in:
parent
a1dcc532ea
commit
41c0d37a13
@ -63,9 +63,15 @@ module YouPlot
|
|||||||
# normal mode
|
# normal mode
|
||||||
else
|
else
|
||||||
# Sometimes the input file does not end with a newline code.
|
# Sometimes the input file does not end with a newline code.
|
||||||
while (input = Kernel.gets(nil))
|
begin
|
||||||
|
begin
|
||||||
|
input = Kernel.gets(nil)
|
||||||
|
rescue Errno::ENOENT => e
|
||||||
|
warn e.message
|
||||||
|
next
|
||||||
|
end
|
||||||
main(input)
|
main(input)
|
||||||
end
|
end until input
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -137,6 +143,10 @@ module YouPlot
|
|||||||
warn 'Please try to set the correct character encoding with --encoding option.'
|
warn 'Please try to set the correct character encoding with --encoding option.'
|
||||||
warn e.backtrace.grep(/youplot/).first
|
warn e.backtrace.grep(/youplot/).first
|
||||||
exit 1
|
exit 1
|
||||||
|
rescue ArgumentError => e
|
||||||
|
warn 'Failed to parse the text. '
|
||||||
|
warn e.backtrace.grep(/youplot/).first
|
||||||
|
exit 1
|
||||||
end
|
end
|
||||||
|
|
||||||
data
|
data
|
||||||
|
Loading…
Reference in New Issue
Block a user