* Truncate error message to prevent buffer overflow in Temporal serialization.
(message: string)
| 83 | * Truncate error message to prevent buffer overflow in Temporal serialization. |
| 84 | */ |
| 85 | function truncateErrorMessage(message: string): string { |
| 86 | if (message.length <= MAX_ERROR_MESSAGE_LENGTH) { |
| 87 | return message; |
| 88 | } |
| 89 | return `${message.slice(0, MAX_ERROR_MESSAGE_LENGTH - 20)}\n[truncated]`; |
| 90 | } |
| 91 | |
| 92 | /** |
| 93 | * Truncate stack trace on an ApplicationFailure to prevent buffer overflow. |
no outgoing calls
no test coverage detected