* Creates a standardized error info object * @param {string} message - Error message * @param {number|null} status - HTTP status code or null for network errors * @param {string} errorType - Error type: AUTH_FAILURE, RATE_LIMITED, SERVER_ERROR, CLIENT_ERROR, NETWORK_ERROR * @param {number} r
(message, status, errorType, retryAfter, originalError = null)
| 258 | * @returns {object} Error info object with translationKey for direct use |
| 259 | */ |
| 260 | #createErrorInfo (message, status, errorType, retryAfter, originalError = null) { |
| 261 | return { |
| 262 | message, |
| 263 | status, |
| 264 | errorType, |
| 265 | translationKey: ERROR_TYPE_TO_TRANSLATION[errorType] || "MODULE_ERROR_UNSPECIFIED", |
| 266 | retryAfter, |
| 267 | retryCount: errorType === "NETWORK_ERROR" ? this.networkErrorCount : this.serverErrorCount, |
| 268 | url: this.url, |
| 269 | originalError |
| 270 | }; |
| 271 | } |
| 272 | |
| 273 | /** |
| 274 | * Performs the HTTP fetch and emits appropriate events |
no outgoing calls
no test coverage detected