Skip to content

Commit abc610e

Browse files
Merge pull request deepgram#462 from dvonthenen/reexpose-error-classes
Re-expose Error Classes
2 parents 66e649b + 0afce18 commit abc610e

39 files changed

+37
-163
lines changed

deepgram/__init__.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,14 @@
2424

2525
from .client import Deepgram, DeepgramClient
2626
from .client import DeepgramClientOptions, ClientOptionsFromEnv
27-
from .client import DeepgramApiKeyError, DeepgramModuleError
27+
from .client import (
28+
DeepgramError,
29+
DeepgramTypeError,
30+
DeepgramModuleError,
31+
DeepgramApiError,
32+
DeepgramUnknownApiError,
33+
)
34+
from .errors import DeepgramApiKeyError
2835

2936
# listen/read client
3037
from .client import Listen, Read
@@ -173,7 +180,7 @@
173180
)
174181

175182
# utilities
176-
from .audio import Microphone
183+
from .audio import Microphone, DeepgramMicrophoneError
177184
from .audio import (
178185
LOGGING,
179186
CHANNELS,

deepgram/audio/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44

55
from .microphone import Microphone
66
from .microphone import LOGGING, CHANNELS, RATE, CHUNK
7+
from .microphone import DeepgramMicrophoneError

deepgram/audio/microphone/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@
44

55
from .microphone import Microphone
66
from .constants import LOGGING, CHANNELS, RATE, CHUNK
7+
from .errors import DeepgramMicrophoneError

deepgram/client.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@
2828
UnhandledResponse,
2929
ErrorResponse,
3030
)
31+
from .clients import (
32+
DeepgramError,
33+
DeepgramTypeError,
34+
DeepgramModuleError,
35+
DeepgramApiError,
36+
DeepgramUnknownApiError,
37+
)
3138

3239
# listen client
3340
from .clients import Listen, Read, Speak
@@ -178,7 +185,7 @@
178185

179186
# client errors and options
180187
from .options import DeepgramClientOptions, ClientOptionsFromEnv
181-
from .errors import DeepgramApiKeyError, DeepgramModuleError
188+
from .errors import DeepgramApiKeyError
182189

183190
# pylint: enable=unused-import
184191

deepgram/clients/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
UnhandledResponse,
1919
ErrorResponse,
2020
)
21+
from .common import DeepgramError, DeepgramTypeError
22+
from .errors import DeepgramModuleError, DeepgramApiError, DeepgramUnknownApiError
2123

2224
from .listen_router import Listen
2325
from .read_router import Read

deepgram/clients/abstract_async_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
from .helpers import append_query_params
1212
from ..options import DeepgramClientOptions
13-
from .errors import DeepgramError, DeepgramApiError, DeepgramUnknownApiError
13+
from .errors import DeepgramApiError, DeepgramUnknownApiError
14+
from .common.v1.errors import DeepgramError
1415

1516

1617
class AbstractAsyncRestClient:

deepgram/clients/abstract_sync_client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010

1111
from .helpers import append_query_params
1212
from ..options import DeepgramClientOptions
13-
from .errors import DeepgramError, DeepgramApiError, DeepgramUnknownApiError
13+
from .errors import DeepgramApiError, DeepgramUnknownApiError
14+
from .common.v1.errors import DeepgramError
1415

1516

1617
class AbstractSyncRestClient:

deepgram/clients/analyze/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,3 @@
77
from .client import AnalyzeOptions
88
from .client import UrlSource, FileSource, AnalyzeStreamSource, AnalyzeSource
99
from .client import AsyncAnalyzeResponse, AnalyzeResponse, SyncAnalyzeResponse
10-
11-
from ...options import DeepgramClientOptions, ClientOptionsFromEnv

deepgram/clients/analyze/v1/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@
1111
AnalyzeStreamSource,
1212
AnalyzeSource,
1313
)
14-
from ....options import DeepgramClientOptions, ClientOptionsFromEnv
1514
from .response import AsyncAnalyzeResponse, AnalyzeResponse, Sentiment

deepgram/clients/analyze/v1/async_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from ....utils import verboselogs
1111
from ....options import DeepgramClientOptions
1212
from ...abstract_async_client import AbstractAsyncRestClient
13-
from ..errors import DeepgramError, DeepgramTypeError
13+
from ...common.v1.errors import DeepgramError, DeepgramTypeError
1414

1515
from .helpers import is_buffer_source, is_readstream_source, is_url_source
1616
from .options import (

0 commit comments

Comments
 (0)