Skip to content

Commit

Permalink
catches file error from underlining lib (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
samueleaton authored Apr 29, 2020
1 parent 4e5962b commit ea45344
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/sentry.cr
Original file line number Diff line number Diff line change
Expand Up @@ -263,13 +263,10 @@ module Sentry
file_changed = true if (app_process && !app_process.terminated?)
end
end
rescue ex
rescue ex : File::Error
# The underlining lib for reading directories will fail very rarely, crashing Sentry
# This catches that error and allows Sentry to carry on normally
# https://github.com/crystal-lang/crystal/blob/59788834554399f7fe838487a83eb466e55c6408/src/errno.cr#L37
unless ex.message == "readdir: Input/output error"
raise ex
end
# https://github.com/crystal-lang/crystal/blob/677422167cbcce0aeea49531896dbdcadd2762db/src/crystal/system/unix/dir.cr#L19
end

start_app() if (file_changed || app_process.nil?)
Expand Down

0 comments on commit ea45344

Please sign in to comment.