Add IOError custom message when rsa key file is missing.
This commit is contained in:
parent
211f942eec
commit
1736d7b7ae
1 changed files with 5 additions and 2 deletions
|
@ -22,7 +22,10 @@ def get_rsa_key():
|
|||
Load the rsa key previously created with `creatersakey` command.
|
||||
"""
|
||||
file_path = settings.get('OIDC_RSA_KEY_FOLDER') + '/OIDC_RSA_KEY.pem'
|
||||
with open(file_path, 'r') as f:
|
||||
key = f.read()
|
||||
try:
|
||||
with open(file_path, 'r') as f:
|
||||
key = f.read()
|
||||
except IOError:
|
||||
raise IOError('We could not find your key file on: ' + file_path)
|
||||
|
||||
return key
|
||||
|
|
Loading…
Reference in a new issue