Skip to main content

Error Types

The SDK provides typed error classes for different error scenarios:

Basic Error Handling

Error Classes

S4KitError

Base class for all S4Kit errors:

ValidationError

Thrown when request data fails validation:

NotFoundError

Thrown when an entity doesn’t exist:

AuthenticationError

Thrown when authentication fails (invalid API key):

AuthorizationError

Thrown when the API key lacks required permissions:

RateLimitError

Thrown when rate limits are exceeded:

NetworkError

Thrown for network-related issues:

ODataError

Thrown when SAP returns an OData error:

Automatic Retries

The SDK automatically retries certain errors:

Disable Retries

Error Handling Patterns

Comprehensive Try-Catch

Error Wrapper

Logging Errors

Error Response Format

When errors occur, the SDK includes helpful debugging information:

Debugging

Enable debug mode for detailed logging:
Or use the S4KIT_DEBUG environment variable: