implement and document GVAFileException
This commit is contained in:
parent
b2acae7dda
commit
ea278eeb35
4 changed files with 26 additions and 2 deletions
12
gvafile/gvafile/exceptions.py
Normal file
12
gvafile/gvafile/exceptions.py
Normal file
|
@ -0,0 +1,12 @@
|
|||
"""
|
||||
This module defines exceptions for gvafile.
|
||||
|
||||
"""
|
||||
from __future__ import unicode_literals
|
||||
|
||||
|
||||
class GVAFileException(Exception):
|
||||
"""
|
||||
Generic Exception class for gvafile.
|
||||
|
||||
"""
|
|
@ -13,7 +13,8 @@ from django.conf import settings
|
|||
|
||||
from celery import shared_task
|
||||
from celery.utils.log import get_task_logger
|
||||
from celery.exceptions import Reject
|
||||
|
||||
from gvafile.exceptions import GVAFileException
|
||||
|
||||
|
||||
_logger = get_task_logger(__name__)
|
||||
|
@ -60,7 +61,7 @@ def setup_file_sftp_userdir(username):
|
|||
except subprocess.CalledProcessError:
|
||||
_logger.exception(
|
||||
'could not create SFTP directory for user %s', username)
|
||||
raise Exception(
|
||||
raise GVAFileException(
|
||||
"could not create SFTP directory for user %s" % username)
|
||||
return sftp_directory
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue