[App] Add cloud platform exception (#13928)
Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
This commit is contained in:
parent
7a617ec90e
commit
4c47619f38
|
@ -518,7 +518,11 @@ class LightningWork(abc.ABC):
|
|||
|
||||
@abc.abstractmethod
|
||||
def run(self, *args, **kwargs):
|
||||
"""Override to add your own logic."""
|
||||
"""Override to add your own logic.
|
||||
|
||||
Raises:
|
||||
LightningPlatformException: If resource exceeds platform quotas or other constraints.
|
||||
"""
|
||||
pass
|
||||
|
||||
def on_exception(self, exception: BaseException):
|
||||
|
|
|
@ -41,6 +41,14 @@ class LightningWorkException(Exception):
|
|||
"""Exception used to inform users of misuse with LightningWork."""
|
||||
|
||||
|
||||
class LightningPlatformException(Exception): # pragma: no cover
|
||||
"""Exception used to inform users of issues related to platform the LightningApp is running on.
|
||||
|
||||
It gets raised by the Lightning Launcher on the platform side when the app is running in the cloud, and is useful
|
||||
when framework or user code needs to catch exceptions specific to the platform, e.g., when resources exceed quotas.
|
||||
"""
|
||||
|
||||
|
||||
class LightningAppStateException(Exception):
|
||||
"""Exception to inform users of app state errors."""
|
||||
|
||||
|
|
Loading…
Reference in New Issue