Every exception raised by notebooklm-py inherits fromDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/teng-lin/notebooklm-py/llms.txt
Use this file to discover all available pages before exploring further.
NotebookLMError, so you can catch all library errors with a single except clause. The hierarchy is organized into three layers: validation and configuration errors, RPC and network errors raised by the transport layer, and domain-specific errors for notebooks, sources, artifacts, and chat.
All exceptions in this library inherit from
NotebookLMError. You can use it as a catch-all to handle any library error uniformly.Exception hierarchy
Base exception
NotebookLMError
Base class for all notebooklm-py exceptions. Import fromnotebooklm directly.
Validation and configuration
ValidationError
Raised when you pass invalid input or parameters to an API method—for example, an unsupportedsource or mode combination in research.start().
ConfigurationError
Raised when authentication or storage configuration is missing or malformed—for example, whenfrom_storage() cannot find a storage_state.json file and no NOTEBOOKLM_AUTH_JSON environment variable is set.
Network errors
NetworkError
Raised for connection failures, DNS errors, and transport-level timeouts that occur before an RPC response is received. You can safely retry onNetworkError.
Attributes:
method_id— The RPC method ID that failed, if known.original_error— The underlying network exception.
RPCTimeoutError
Raised when an RPC request exceeds its timeout. Inherits fromNetworkError since timeouts are transport-level.
Attributes:
timeout_seconds— The timeout duration that was exceeded.method_id— The RPC method that timed out.original_error— The underlying timeout exception.
RPC errors
RPCError
Base class for all failures that occur after a connection is established. Raised when the Google API returns an error response. Attributes:method_id— RPC method ID for debugging.raw_response— First 500 characters of the raw response.rpc_code— Google’s internal error code, if available.
DecodingError
Raised when the library cannot parse the API response structure. This usually indicates Google has changed the response format.UnknownRPCMethodError
Raised when the response structure does not match expectations. Check for a newer version of notebooklm-py if you see this error.AuthError
Raised for authentication and authorization failures (HTTP 401/403). The client automatically attempts to refresh CSRF tokens on auth errors. If the underlying session cookies have expired, you must re-runnotebooklm login.
Attributes:
recoverable—Truewhen re-authentication might resolve the error.
RateLimitError
Raised when Google’s API rate limit or daily quota is exceeded. Attributes:retry_after— Seconds to wait before retrying, if provided by the API.
ServerError
Raised for HTTP 5xx responses from Google’s servers. Attributes:status_code— The HTTP status code (500–599).
ClientError
Raised for HTTP 4xx responses that are not authentication or rate-limit errors. Attributes:status_code— The HTTP status code (400–499).
Domain errors: notebooks
NotebookError
Base class for notebook operation errors.NotebookNotFoundError
Raised when a notebook ID does not exist or is not accessible. Attributes:notebook_id— The ID that was not found.
NotebookLimitError
Raised when creating a notebook would exceed the account’s quota. The error message includes the current count and a link to manage notebooks. Attributes:current_count— Number of owned notebooks reported by the list API.limit— Server-reported notebook limit, if known.
Domain errors: sources
SourceError
Base class for source operation errors.SourceAddError
Raised when adding a source fails. Common causes include invalid URLs, paywalled content, empty pages, or rate limiting. Attributes:url— The URL or identifier that failed.cause— The underlying exception.
SourceNotFoundError
Raised when a source ID does not exist in the specified notebook. Attributes:source_id— The ID that was not found.
SourceProcessingError
Raised when a source enters an error state during processing (status=3). Attributes:source_id— The ID of the failed source.status— The status code (typically3for ERROR).
SourceTimeoutError
Raised whensource wait or polling exceeds the configured timeout while waiting for a source to become ready.
Attributes:
source_id— The ID of the source.timeout— The timeout duration in seconds.last_status— The last observed status before the timeout.
Domain errors: artifacts
ArtifactError
Base class for artifact operation errors.ArtifactNotFoundError
Raised when an artifact ID does not exist in the specified notebook or when no completed artifact of the requested type is found. Attributes:artifact_id— The ID that was not found.artifact_type— The type of artifact (e.g.,"audio","video").
ArtifactNotReadyError
Raised when you attempt to download an artifact that has not yet completed generation. Attributes:artifact_type— The type of artifact.artifact_id— The ID, if known.status— The current status string, if known.
ArtifactParseError
Raised when the library cannot parse artifact content into the expected format. Attributes:artifact_type— The type being parsed.artifact_id— The ID, if known.details— Additional error details.cause— The underlying exception.
ArtifactDownloadError
Raised when downloading artifact content fails—for example, when the download URL is expired or inaccessible. Attributes:artifact_type— The type being downloaded.artifact_id— The ID, if known.details— Additional error details.cause— The underlying exception.
Domain errors: chat
ChatError
Base class for chat operation errors. Raised when a question cannot be processed by the chat API.Warnings
UnknownTypeWarning
AUserWarning emitted (not raised) when the API returns a source or artifact type code that notebooklm-py does not recognize. The .kind property returns SourceType.UNKNOWN or ArtifactType.UNKNOWN in this case.