Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions deepomatic/api/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ class DeepomaticException(Exception):
def __init__(self, msg):
super(DeepomaticException, self).__init__(msg)

###############################################################################


class CredentialsNotFound(DeepomaticException):
pass


###############################################################################

Expand Down
5 changes: 3 additions & 2 deletions deepomatic/api/http_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@

import requests
from deepomatic.api.exceptions import (BadStatus, ServerError,
ClientError, DeepomaticException)
ClientError, DeepomaticException,
CredentialsNotFound)
from deepomatic.api.http_retry import HTTPRetry
from deepomatic.api.version import __title__, __version__
from requests.structures import CaseInsensitiveDict
Expand Down Expand Up @@ -76,7 +77,7 @@ def __init__(self, app_id=None, api_key=None, verify_ssl=None,
if api_key is None:
api_key = os.getenv('DEEPOMATIC_API_KEY')
if api_key is None:
raise DeepomaticException("Please specify 'api_key' either by passing it to the client"
raise CredentialsNotFound("Please specify 'api_key' either by passing it to the client"
" or by defining the DEEPOMATIC_API_KEY environment variable.")

if version is None or version == '':
Expand Down