diff options
author | Tekky <98614666+xtekky@users.noreply.github.com> | 2023-12-13 15:27:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-13 15:27:55 +0100 |
commit | 99127111f525d4ed1469c3547bcb491a8cdf5963 (patch) | |
tree | 10ed7693fe0116fa91ab9c77cbc0aa0951417f75 /g4f/Provider | |
parent | ~ (diff) | |
parent | Change default port for gui (diff) | |
download | gpt4free-99127111f525d4ed1469c3547bcb491a8cdf5963.tar gpt4free-99127111f525d4ed1469c3547bcb491a8cdf5963.tar.gz gpt4free-99127111f525d4ed1469c3547bcb491a8cdf5963.tar.bz2 gpt4free-99127111f525d4ed1469c3547bcb491a8cdf5963.tar.lz gpt4free-99127111f525d4ed1469c3547bcb491a8cdf5963.tar.xz gpt4free-99127111f525d4ed1469c3547bcb491a8cdf5963.tar.zst gpt4free-99127111f525d4ed1469c3547bcb491a8cdf5963.zip |
Diffstat (limited to 'g4f/Provider')
-rw-r--r-- | g4f/Provider/retry_provider.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/g4f/Provider/retry_provider.py b/g4f/Provider/retry_provider.py index 6fdefe0f..e49b6da6 100644 --- a/g4f/Provider/retry_provider.py +++ b/g4f/Provider/retry_provider.py @@ -6,6 +6,7 @@ from typing import List, Type, Dict from ..typing import CreateResult, Messages from .base_provider import BaseProvider, AsyncProvider from .. import debug +from ..errors import RetryProviderError, RetryNoProviderError class RetryProvider(AsyncProvider): @@ -84,8 +85,8 @@ class RetryProvider(AsyncProvider): def raise_exceptions(self) -> None: if self.exceptions: - raise RuntimeError("\n".join(["RetryProvider failed:"] + [ - f"{p}: {self.exceptions[p].__class__.__name__}: {self.exceptions[p]}" for p in self.exceptions + raise RetryProviderError("RetryProvider failed:\n" + "\n".join([ + f"{p}: {exception.__class__.__name__}: {exception}" for p, exception in self.exceptions.items() ])) - raise RuntimeError("RetryProvider: No provider found")
\ No newline at end of file + raise RetryNoProviderError("No provider found")
\ No newline at end of file |