* Checks if an error message indicates a body size limit issue * @param errorMessage - The error message to check * @returns true if the error is related to body size limits
(errorMessage: string)
| 722 | * @returns true if the error is related to body size limits |
| 723 | */ |
| 724 | function isBodySizeLimitError(errorMessage: string): boolean { |
| 725 | const lowerMessage = errorMessage.toLowerCase() |
| 726 | return ( |
| 727 | lowerMessage.includes('body size') || |
| 728 | lowerMessage.includes('payload too large') || |
| 729 | lowerMessage.includes('entity too large') || |
| 730 | lowerMessage.includes('request entity too large') || |
| 731 | lowerMessage.includes('body_not_allowed') || |
| 732 | lowerMessage.includes('request body larger than') |
| 733 | ) |
| 734 | } |
| 735 | |
| 736 | /** |
| 737 | * Handles body size limit errors by logging and throwing a user-friendly error |
no outgoing calls
no test coverage detected