Exception Hierarchy
Every Speckle-specific exception derives fromSpeckleException (itself a plain Exception). That covers most SDK-thrown failures — but not GraphQL response errors from IClient resource calls, which the SDK always wraps in a plain AggregateException. See GraphQL Exceptions below before you write a single catch (SpeckleException) block and assume it covers everything.
Core Exceptions
Exception
Base type for all intentional Speckle.Sdk errors. Catch this to handle any SDK-thrown failure
generically.
SpeckleException
A transport (
ServerTransport, SQLiteTransport, MemoryTransport) failed to save or retrieve
an object. Exposes the failing Transport instance.SpeckleException
Deserialization of a received object graph failed — often due to a missing type registration (see
the warning below) or corrupted/incompatible data.
SpeckleException
Thrown when setting a dynamic property on a
Base with an invalid name (empty, .//
characters, or a double @@ prefix).GraphQL Exceptions
Unwrap theAggregateException to inspect the underlying error, mapped from the server’s GraphQL error code:
WorkspacePermissionException is not in this table — see Workspace Permission Errors below; it isn’t thrown through this wrapping path.
Example
GraphQL calls typically produce a single error, so
ex.InnerException (the first inner exception)
is usually enough. If you need to handle a request that can fail with multiple simultaneous
errors, iterate ex.InnerExceptions instead, or call ex.Flatten() first.Workspace Permission Errors
WorkspacePermissionException is a SpeckleGraphQLException subclass, but it isn’t mapped from a GraphQL error code and isn’t wrapped in an AggregateException. It’s thrown directly by client-side permission checks — for example after calling a CanCreateModelIngestion-style permission check and not handling a denied result:
Example
SpeckleException (not AggregateException), a catch (SpeckleException) block does catch it — unlike the GraphQL error-code exceptions above.
PermissionCheckResult uses property authorized (US spelling) and method EnsureAuthorised()
(UK spelling) — both match the SDK.Common Failure Modes
SpeckleDeserializeException or objects come back as plain Base
SpeckleDeserializeException or objects come back as plain Base
The type’s assembly wasn’t passed to
AddSpeckleSdk. See Dependency injection (connectors):
Registering your own
types.SpeckleException: GraphQL response indicated that the ActiveUser could not be found
SpeckleException: GraphQL response indicated that the ActiveUser could not be found
The account’s token is invalid or expired. Re-authenticate — see
Authentication.
AggregateException wrapping SpeckleGraphQLWorkspaceNotEnabledException
AggregateException wrapping SpeckleGraphQLWorkspaceNotEnabledException
You called a
client.Workspace method against a server without workspaces enabled. Check with
client.Server.IsWorkspaceEnabled() first. Remember to catch AggregateException and inspect
InnerException, not SpeckleGraphQLWorkspaceNotEnabledException directly.TransportException with no fallback remote
TransportException with no fallback remote
Receive was called with a localTransport that doesn’t have the object, and no
remoteTransport was provided to fall back to.Next Steps
Core concepts
Platform footguns that surface as exceptions
Handling server capabilities
Permission check patterns
Client API
GraphQL calls that throw AggregateException