Convention: most B2Error subclasses represent failures returned by the B2
API. The client-side exceptions are B2BucketConfigurationError,
B2RealmConfigurationError, and B2PartnerAuthorizationError;
they extend B2Error so validation, realm-, and Partner-authorization
failures can be handled with the SDK error hierarchy before or without a
server round-trip.
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 exceptions are B2BucketConfigurationError, B2RealmConfigurationError, and B2PartnerAuthorizationError; they extendB2Errorso validation, realm-, and Partner-authorization failures can be handled with the SDK error hierarchy before or without a server round-trip.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.