The generated requestBuilder always passes an empty map to the requestAdapter for the errorMapping:
Future<Post?> postAsync(Post body, [void Function(RequestConfiguration<DefaultQueryParameters>)? requestConfiguration]) async {
var requestInfo = toPostRequestInformation(body, requestConfiguration);
return await requestAdapter.send<Post>(requestInfo, Post.createFromDiscriminatorValue, {});
/* ↑ errorMapping */
}
The default HttpClientRequestAdapter could handle the errorMapping, but a missing errorMapping will always cause an ApiException to be thrown, which has to be handled with a trycatch block.
The generated requestBuilder always passes an empty map to the requestAdapter for the
errorMapping:The default
HttpClientRequestAdaptercould handle theerrorMapping, but a missingerrorMappingwill always cause anApiExceptionto be thrown, which has to be handled with atrycatchblock.