Convention: most B2Error subclasses represent failures returned by the B2
API. The client-side exception is B2RealmConfigurationError; it
extends B2Error so realm-validation failures can be handled with the SDK
error hierarchy before credentials are sent.
Typed error hierarchy for B2 API failures.
Every B2 error response maps to a specific B2Error subclass. Retry behavior is exposed through B2Error.retryable. Examples include ExpiredAuthTokenError and CapExceededError. Use classifyError to convert a raw error response into the appropriate subclass.
Convention: most
B2Errorsubclasses represent failures returned by the B2 API. The client-side exception is B2RealmConfigurationError; it extendsB2Errorso realm-validation failures can be handled with the SDK error hierarchy before credentials are sent.Other programming errors and SDK preconditions, such as "not yet authorized", "stream consumed twice", or "called before init", use the native
Errorconstructor instead. The directErroroutliers are B2InsufficientCapabilityError, B2RedirectError, B2SsrfError, NetworkError, ResumeFileIdMismatchError, UploadResponseBodyError, and FinishLargeFileResponseBodyError.