Skip to content

Commit 4aa2c10

Browse files
committed
removed timout in favor of isinteractive
1 parent 07e3fd7 commit 4aa2c10

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

src/error_handling.jl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,10 @@ end
5959
handle_error(e, q) = rethrow(e)
6060

6161
function handle_error(e::NotInstalledError, q)
62-
time_out_time = 50 #tempted to make this global, but only makes sense if we allow to set it.
6362
println("Library ", e.library, " is not installed but can load format: ", q)
64-
println("should we install ", e.library, " for you? (y/n):")
65-
start_time = time()
66-
while time() - start_time < time_out_time # give user time_out_time seconds to react, then time out
63+
!isinteractive() && rethrow(e) # if we're not in interactive mode just throw
64+
while true
65+
println("should we install ", e.library, " for you? (y/n):")
6766
input = lowercase(chomp(strip(readline(STDIN))))
6867
if input == "y"
6968
info(string("Start installing ", e.library, "..."))
@@ -76,7 +75,6 @@ function handle_error(e::NotInstalledError, q)
7675
println("$input is not a valid choice. Try typing y or n")
7776
end
7877
end
79-
info(string("Time out after $time_out_time seconds! Not installing ", e.library))
8078
true # User does not install, continue going through errors.
8179
end
8280

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
eval(Base, :(is_interactive = true)) # for interactive error handling
12
using FileIO
23
using FactCheck
3-
44
facts("FileIO") do
55
include("query.jl")
66
include("loadsave.jl")

0 commit comments

Comments
 (0)