5.15.0 — 2026-10-14¶
← 5.16.0 | 5.14.0 → | ↑ 5.x series
Added¶
Helpers - Errors¶
archipy.helpers.errorspackage - One home for error handling on both transports.capture_exception,format_validation_errors,request_validation,invalid_argument_from_validationandresolve_error(maps any exception to theBaseErrora client should see).archipy.helpers.errors.fastapi:setup_exception_handlers,handle_fastapi_exception,handle_unexpected_exception,create_error_responseandget_fastapi_exception_responses.archipy.helpers.errors.grpc:GrpcExceptionInterceptor,abort_grpcandgrpc_status_code.
GrpcExceptionInterceptor- One name for both kinds of server:GrpcExceptionInterceptor()is the sync interceptor andGrpcExceptionInterceptor(aio=True)thegrpc.aioone. The sync and async variants share one error mapping instead of repeating it.abort_grpc(error, context)- ReplacesBaseError.abort_grpc_syncandabort_grpc_async. It detects a sync orgrpc.aiocontext; on an async context useawait abort_grpc(error, context).validation_errors_as_internal- New keyword onAppUtils.create_grpc_appandcreate_async_grpc_app.
Changed¶
Behavior¶
- gRPC validation errors - A Pydantic
ValidationErrorraised by a gRPC handler is now reported asINVALID_ARGUMENT, the counterpart of the HTTP 422 the FastAPI handlers return. It used to beINTERNAL. Passvalidation_errors_as_internal=Trueto keep the old mapping. - FastAPI handler - A
BaseErrorhandled throughhandle_fastapi_exceptionis now logged and recorded on the current OTel span, like the registered handlers already did.
Layout¶
- Error handling moved - The FastAPI handlers left
app_utils.pyand the gRPC interceptor lefthelpers/interceptors/grpc/exception/.BaseErrorno longer importsgrpc;http_statusandgrpc_statusstay plain class attributes. - Removed (internal only) -
FastAPIExceptionHandler,FastAPIUtils.setup_exception_handlers,GrpcServerExceptionInterceptor,AsyncGrpcServerExceptionInterceptor,BaseError.abort_grpc_sync,abort_grpc_async,abort_with_error_sync,abort_with_error_async,ErrorUtils.handle_grpc_exception,BaseUtils.format_validation_errorsandarchipy.models.dtos.fastapi_exception_response_dto. Apps that useAppUtils.create_fastapi_app,create_grpc_appandcreate_async_grpc_appare not affected. - Shared deprecation helper -
deprecated_aliasandwarn_deprecated_namemoved toarchipy.helpers._deprecation.
Deprecated¶
BaseUtils.capture_exception- usearchipy.helpers.errors.capture_exception.BaseUtils.async_handle_fastapi_exception- usearchipy.helpers.errors.fastapi.handle_fastapi_exception.BaseUtils.get_fastapi_exception_responses- usearchipy.helpers.errors.fastapi.get_fastapi_exception_responses.
Each emits a DeprecationWarning that names the replacement and returns the same result.
Tests¶
- The gRPC validation scenarios in
error_handling.featurenow expectINVALID_ARGUMENTby default andINTERNALwith the opt-out. Test steps use the newarchipy.helpers.errorspaths.
Chore¶
- Docs - New errors API reference page; the interceptors, utils, error handling and observability tutorials use the new paths.