UNPKG

@juspay/neurolink

Version:

Universal AI Development Platform with working MCP integration, multi-provider support, and professional CLI. Built-in tools operational, 58+ external MCP servers discoverable. Connect to filesystem, GitHub, database operations, and more. Build, test, and

79 lines (78 loc) 7.66 kB
/** * Error message constants and templates for Amazon SageMaker Provider * * This module contains all error message templates, prefixes, and constants * used throughout the SageMaker provider for consistent error handling. */ /** * Error message prefixes for different error types */ export declare const ERROR_MESSAGE_PREFIXES: { readonly VALIDATION: "Invalid request parameters"; readonly MODEL: "Model execution error"; readonly INTERNAL: "Internal server error"; readonly SERVICE_UNAVAILABLE: "SageMaker service is temporarily unavailable"; readonly THROTTLING: "Request rate limit exceeded"; readonly CREDENTIALS: "AWS credentials are invalid or missing"; readonly NETWORK: "Network error while connecting to SageMaker"; readonly ENDPOINT_NOT_FOUND: "SageMaker endpoint not found"; readonly VALIDATION_FIELD: "Validation failed for"; readonly CREDENTIALS_SETUP: "AWS credentials error"; readonly NETWORK_CONNECTION: "Network error"; }; /** * Detailed error message templates for user guidance */ export declare const ERROR_MESSAGE_TEMPLATES: { readonly VALIDATION_ERROR: "❌ SageMaker Request Validation Error{endpointContext}\n\n{originalMessage}\n\n🔧 Common Solutions:\n1. Check your request parameters and format\n2. Verify the endpoint name is correct\n3. Ensure your request body matches the expected model format\n4. Validate that required parameters are included\n\n💡 Tips:\n- Double-check the endpoint name spelling\n- Ensure JSON format is valid if using JSON content type\n- Verify parameter types match model expectations"; readonly MODEL_ERROR: "❌ SageMaker Model Execution Error{endpointContext}\n\n{originalMessage}\n\n🔧 Common Solutions:\n1. Check if the model is properly deployed and in 'InService' status\n2. Verify your input format matches what the model expects\n3. Ensure input size is within model limits\n4. Check if the model container is healthy\n\n💡 Tips:\n- Try with a simpler input to test model health\n- Check CloudWatch logs for detailed model errors\n- Verify model dependencies are properly installed"; readonly INTERNAL_ERROR: "❌ SageMaker Internal Server Error{endpointContext}\n\n{originalMessage}\n\n🔧 Common Solutions:\n1. Retry the request after a short delay\n2. Check AWS Service Health Dashboard\n3. Verify your endpoint is still active and healthy\n4. Contact AWS support if issue persists\n\n💡 Tips:\n- This is usually a temporary issue\n- Implement exponential backoff for retries\n- Check if other endpoints are working"; readonly SERVICE_UNAVAILABLE: "❌ SageMaker Service Temporarily Unavailable{endpointContext}\n\n{originalMessage}\n\n🔧 Common Solutions:\n1. Wait and retry after a few seconds\n2. Check AWS region status\n3. Verify your endpoint hasn't been deleted\n4. Check if you've hit account limits\n\n💡 Tips:\n- Service issues are usually temporary\n- Implement retry logic with backoff\n- Monitor AWS Service Health Dashboard"; readonly CREDENTIALS_ERROR: "❌ AWS Credentials Error{endpointContext}\n\n{originalMessage}\n\n🔧 Required Steps:\n1. Verify AWS_ACCESS_KEY_ID is set correctly\n2. Verify AWS_SECRET_ACCESS_KEY is set correctly\n3. Check AWS_SESSION_TOKEN if using temporary credentials\n4. Ensure credentials have SageMaker permissions\n\n🔑 Required IAM Permissions:\n- sagemaker:InvokeEndpoint\n- sagemaker:InvokeEndpointWithResponseStream\n- sagemaker:DescribeEndpoint (optional, for debugging)\n\n💡 Setup Help:\n- Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables\n- Check IAM user has necessary permissions\n- Verify credentials haven't expired"; readonly NETWORK_ERROR: "❌ Network Connection Error{endpointContext}\n\n{originalMessage}\n\n🔧 Common Solutions:\n1. Check your internet connection\n2. Verify firewall/proxy settings\n3. Try different DNS servers\n4. Check if SageMaker service is accessible from your network\n\n💡 Network Troubleshooting:\n- Test connectivity to other AWS services\n- Check for VPC/subnet restrictions if running in AWS\n- Verify security group rules allow outbound HTTPS"; readonly ENDPOINT_NOT_FOUND: "❌ SageMaker Endpoint Not Found{endpointContext}\n\n{originalMessage}\n\n🔧 Common Solutions:\n1. Verify the endpoint name is spelled correctly\n2. Check if the endpoint exists in the correct AWS region\n3. Ensure the endpoint is in 'InService' status\n4. Verify you have permissions to access the endpoint\n\n💡 Endpoint Management:\n- List endpoints: aws sagemaker list-endpoints\n- Check status: aws sagemaker describe-endpoint --endpoint-name <name>\n- Ensure endpoint is deployed in the same region"; readonly THROTTLING_ERROR: "❌ Request Rate Limit Exceeded{endpointContext}\n\n{originalMessage}\n\n🔧 Common Solutions:\n1. Implement exponential backoff retry logic\n2. Reduce request rate\n3. Consider using batch inference for large workloads\n4. Request higher limits from AWS support if needed\n\n💡 Rate Limiting Tips:\n- Space out requests over time\n- Use batch processing when possible\n- Monitor your request patterns\n- Consider auto-scaling your endpoint"; readonly UNKNOWN_ERROR: "❌ Unknown SageMaker Error{endpointContext}\n\n{originalMessage}\n\n🔧 General Troubleshooting:\n1. Check AWS credentials and permissions\n2. Verify endpoint name and status\n3. Check network connectivity\n4. Review request format and parameters\n\n💡 Additional Help:\n- Check CloudWatch logs for detailed errors\n- Verify SageMaker service health\n- Consult AWS SageMaker documentation\n- Contact AWS support for persistent issues"; readonly DEFAULT: "❌ SageMaker Error{endpointContext}\n\n{originalMessage}\n\n🔧 General Troubleshooting:\n1. Check AWS credentials and permissions\n2. Verify endpoint name and status\n3. Check network connectivity\n4. Review request format and parameters\n\n💡 Additional Help:\n- Check CloudWatch logs for detailed errors\n- Verify SageMaker service health\n- Consult AWS SageMaker documentation\n- Contact AWS support for persistent issues"; }; /** * Retry delay constants for different error types (in milliseconds) */ export declare const RETRY_DELAYS: { readonly THROTTLING_ERROR: 5000; readonly SERVICE_UNAVAILABLE: 2000; readonly NETWORK_ERROR: 1000; readonly DEFAULT: 1000; }; /** * List of retryable AWS SDK error names and conditions */ export declare const RETRYABLE_ERROR_CONDITIONS: { readonly ERROR_NAMES: readonly ["ServiceUnavailable", "InternalFailure", "ThrottlingException", "NetworkingError"]; readonly ERROR_MESSAGE_KEYWORDS: readonly ["timeout", "throttl", "unavailable", "internal", "network"]; }; /** * AWS SDK error name mappings to SageMaker error codes */ export declare const AWS_ERROR_MAPPINGS: { readonly ValidationException: "VALIDATION_ERROR"; readonly ModelError: "MODEL_ERROR"; readonly InternalFailure: "INTERNAL_ERROR"; readonly ServiceUnavailable: "SERVICE_UNAVAILABLE"; readonly ThrottlingException: "THROTTLING_ERROR"; readonly CredentialsError: "CREDENTIALS_ERROR"; readonly NetworkingError: "NETWORK_ERROR"; }; /** * Common error message keywords for pattern matching */ export declare const ERROR_KEYWORDS: { readonly VALIDATION: readonly ["validation"]; readonly MODEL: readonly ["model error"]; readonly INTERNAL: readonly ["internal"]; readonly SERVICE_UNAVAILABLE: readonly ["unavailable"]; readonly THROTTLING: readonly ["throttl"]; readonly CREDENTIALS: readonly ["credential"]; readonly NETWORK: readonly ["network"]; readonly ENDPOINT_NOT_FOUND: readonly ["endpoint", "not found"]; };