load_credentials just returns nil on errors
This commit is contained in:
parent
31fac0a6f5
commit
4666fedaed
|
@ -37,10 +37,9 @@ module Google
|
||||||
##
|
##
|
||||||
# Attempt to read in credentials from the specified file.
|
# Attempt to read in credentials from the specified file.
|
||||||
def load_credentials
|
def load_credentials
|
||||||
if File.exists?(path) && File.readable?(path) && File.writable?(path)
|
File.open(path, 'r') { |f| JSON.parse(f.read) }
|
||||||
credentials = File.open(path, 'r') { |f| JSON.parse(f.read) }
|
rescue
|
||||||
end
|
nil
|
||||||
credentials
|
|
||||||
end
|
end
|
||||||
|
|
||||||
##
|
##
|
||||||
|
|
Loading…
Reference in New Issue