Error Codes
The following table lists client error codes that the Vaultera Switch SDK returns to your website for graceful handling.| Error Type | Error Message |
|---|---|
invalid_request_error | Invalid API key |
invalid_request_error | Invalid value for <parameter_name> |
invalid_request_error | Missing required parameter: <parameter_name> |
invalid_request_error | Invalid client secret |
invalid_request_error | Invalid promise |
processing_error | Payment failed with the payment processor |
internal_server_error | Server is unavailable |
object_not_found | Payment does not exist |
confirm_payment_failed | An unknown error occurred |
Error Handling Best Practices
When implementing error handling in your application:- Check for specific error types to provide appropriate user feedback
- Log errors appropriately for debugging and monitoring purposes
- Provide clear user messages that help users understand what went wrong
- Implement retry logic where appropriate for transient errors
- Have fallback mechanisms for critical payment flows
Common Error Scenarios
- Invalid API Key: Ensure you’re using the correct publishable key for your environment
- Missing Parameters: Verify all required parameters are included in your requests
- Invalid Client Secret: Check that the client secret is valid and hasn’t expired
- Payment Processor Errors: These may be temporary - consider implementing retry logic
- Server Unavailable: Implement appropriate fallback messaging for users