Skip to content

Commit 8c3e58d

Browse files
committed
Don't fail on non-writable token store
If we have to renew a token, we don't want to fail completly if we can't write the token to disk. As such, turn an implied die to a warn - as we can still send the API call - we'll just end up getting another token next run.
1 parent bf70507 commit 8c3e58d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

functions.pm

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ sub get_token(\%) {
3737
$hash->{token_expires} = $response->{expires_in} + time() - 60;
3838

3939
## Write the file to disk.
40-
store $hash, dirname($0) . "/tokenstore.bin";
40+
store $hash, dirname($0) . "/tokenstore.bin" or warn "Unable to write token store to disk. Proceeding anyway. $!";
4141
}
4242

4343
return;

0 commit comments

Comments
 (0)