@plyaz/api 1.6.7 → 1.6.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { abortRequest as abortRequest$1, isSlowConnection as isSlowConnection$1, deleteCache as deleteCache$1, getCache as getCache$1, mutate, setCache as setCache$1, subscribe as subscribe$1, revalidateAll as revalidateAll$1, revalidate, setDefaultConfig, createApiFetcher } from 'fetchff';
2
2
  export { removeRevalidators, revalidate, revalidateAll } from 'fetchff';
3
- import { ApiPackageError as ApiPackageError$1, emitScopedErrorEvent, generateCorrelationId, generateRequestId, generateTraceCorrelationId, registerEventFactory, registerErrorHandler as registerErrorHandler$1, registerScopedHandlers, setErrorHandlers as setErrorHandlers$1, getErrorHandlers as getErrorHandlers$1, unregisterScopedHandlers, clearErrorHandlers as clearErrorHandlers$1, registerOnceErrorHandler, isErrorSystemInitialized, setErrorLocale, addMessageCatalog, initializeErrorSystem } from '@plyaz/errors';
3
+ import { ApiPackageError as ApiPackageError$1, emitScopedErrorEvent, generateCorrelationId, generateRequestId, generateTraceCorrelationId, registerEventFactory, registerErrorHandler as registerErrorHandler$1, registerScopedHandlers, setErrorHandlers as setErrorHandlers$1, getErrorHandlers as getErrorHandlers$1, unregisterScopedHandlers, clearErrorHandlers as clearErrorHandlers$1, registerOnceErrorHandler, isErrorSystemInitialized, setErrorLocale, addMessageCatalog, initializeErrorSystem, getErrorCodeByStatus } from '@plyaz/errors';
4
4
  export { getErrorCategory, getErrorCodeByStatus, getErrorDefinition } from '@plyaz/errors';
5
5
  import { PRIORITY_LEVEL, EVENT_SCOPES_WITH_TEMPORARY, EVENT_NAMESPACES, HEADER_EVENTS, NETWORK_EVENTS, ERROR_EVENTS, DEBUG_EVENTS, CONFIG_EVENTS, PERFORMANCE_EVENTS, CACHE_EVENTS, CLIENT_EVENTS, NETWORK_QUALITY, EVENT_PRIORITY_MAP, PACKAGE_STATUS_CODES, API_ERROR_CODES, OPERATIONS, HISTORY_TYPES, EVENT_SCOPES as EVENT_SCOPES$1, HANDLER_SCOPES as HANDLER_SCOPES$1, DEFAULT_THRESHOLDS, NETWORK_CONFIDENCE_LEVELS, UPDATE_STRATEGIES, DEBUGGER_CONFIG_SOURCES, RTT_THRESHOLDS, SPEED_THRESHOLDS, REGIONAL_CONFIDENCE_LEVELS as REGIONAL_CONFIDENCE_LEVELS$1, COORDINATES, STORAGE_TYPES, ERROR_FIELDS, EVENT_OPERATIONS } from '@plyaz/types/api';
6
6
  export { NETWORK_QUALITY, PUB_SUB_EVENT } from '@plyaz/types/api';
@@ -21596,7 +21596,7 @@ function createOnErrorHandler(handlers, clearTemporaryOverrides2, clearOnComplet
21596
21596
  const apiError = new ApiPackageError(
21597
21597
  "request.failed",
21598
21598
  PACKAGE_STATUS_CODES.REQUEST_FAILED,
21599
- error.status ? `HTTP_${error.status}` : API_ERROR_CODES.NETWORK_ERROR,
21599
+ error.status ? getErrorCodeByStatus(error.status) ?? API_ERROR_CODES.CLIENT_ERROR : API_ERROR_CODES.NETWORK_ERROR,
21600
21600
  {
21601
21601
  cause: error,
21602
21602
  context: {