From b769d0a11791e7f5081359dc2989b7025051666d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Thu, 29 Dec 2022 01:54:40 +0000 Subject: [PATCH] Update services based on v1.44.169 of AWS Go SDK Reference: https://github.com/aws/aws-sdk-go/releases/tag/v1.44.169 --- .latest-tag-aws-sdk-go | 2 +- src/aws_accessanalyzer.erl | 8 +- src/aws_account.erl | 8 +- src/aws_amp.erl | 8 +- src/aws_amplify.erl | 8 +- src/aws_amplifybackend.erl | 8 +- src/aws_amplifyuibuilder.erl | 8 +- src/aws_api_gateway.erl | 8 +- src/aws_apigatewaymanagementapi.erl | 8 +- src/aws_apigatewayv2.erl | 8 +- src/aws_app_mesh.erl | 8 +- src/aws_appconfig.erl | 8 +- src/aws_appconfigdata.erl | 8 +- src/aws_appflow.erl | 8 +- src/aws_appintegrations.erl | 8 +- src/aws_applicationcostprofiler.erl | 8 +- src/aws_appsync.erl | 8 +- src/aws_arc_zonal_shift.erl | 8 +- src/aws_auditmanager.erl | 8 +- src/aws_backup.erl | 8 +- src/aws_backupstorage.erl | 8 +- src/aws_batch.erl | 8 +- src/aws_billingconductor.erl | 8 +- src/aws_braket.erl | 8 +- src/aws_chime.erl | 8 +- src/aws_chime_sdk_identity.erl | 8 +- src/aws_chime_sdk_media_pipelines.erl | 8 +- src/aws_chime_sdk_meetings.erl | 8 +- src/aws_chime_sdk_messaging.erl | 8 +- src/aws_chime_sdk_voice.erl | 8 +- src/aws_clouddirectory.erl | 8 +- src/aws_cloudfront.erl | 8 +- src/aws_cloudsearch_domain.erl | 8 +- src/aws_codeartifact.erl | 8 +- src/aws_codeguru_reviewer.erl | 8 +- src/aws_codeguruprofiler.erl | 8 +- src/aws_codestar_notifications.erl | 8 +- src/aws_cognito_sync.erl | 8 +- src/aws_connect.erl | 8 +- src/aws_connect_contact_lens.erl | 8 +- src/aws_connectcampaigns.erl | 8 +- src/aws_connectcases.erl | 8 +- src/aws_connectparticipant.erl | 8 +- src/aws_controltower.erl | 8 +- src/aws_customer_profiles.erl | 8 +- src/aws_databrew.erl | 8 +- src/aws_dataexchange.erl | 8 +- src/aws_detective.erl | 8 +- src/aws_devops_guru.erl | 8 +- src/aws_dlm.erl | 8 +- src/aws_docdb_elastic.erl | 8 +- src/aws_drs.erl | 8 +- src/aws_ebs.erl | 8 +- src/aws_efs.erl | 8 +- src/aws_eks.erl | 8 +- src/aws_elastic_inference.erl | 8 +- src/aws_elastic_transcoder.erl | 8 +- src/aws_elasticsearch.erl | 8 +- src/aws_emr_containers.erl | 8 +- src/aws_emr_serverless.erl | 8 +- src/aws_evidently.erl | 8 +- src/aws_finspace.erl | 8 +- src/aws_finspace_data.erl | 8 +- src/aws_fis.erl | 8 +- src/aws_gamesparks.erl | 8 +- src/aws_glacier.erl | 8 +- src/aws_grafana.erl | 8 +- src/aws_greengrass.erl | 8 +- src/aws_greengrassv2.erl | 8 +- src/aws_groundstation.erl | 8 +- src/aws_guardduty.erl | 8 +- src/aws_honeycode.erl | 8 +- src/aws_imagebuilder.erl | 8 +- src/aws_inspector2.erl | 8 +- src/aws_iot.erl | 8 +- src/aws_iot_1click_devices.erl | 8 +- src/aws_iot_1click_projects.erl | 8 +- src/aws_iot_data_plane.erl | 8 +- src/aws_iot_events.erl | 8 +- src/aws_iot_events_data.erl | 8 +- src/aws_iot_jobs_data_plane.erl | 8 +- src/aws_iot_roborunner.erl | 8 +- src/aws_iot_wireless.erl | 8 +- src/aws_iotanalytics.erl | 8 +- src/aws_iotdeviceadvisor.erl | 8 +- src/aws_iotfleethub.erl | 8 +- src/aws_iotsitewise.erl | 8 +- src/aws_iottwinmaker.erl | 8 +- src/aws_ivs.erl | 8 +- src/aws_ivschat.erl | 8 +- src/aws_kafka.erl | 8 +- src/aws_kafkaconnect.erl | 8 +- src/aws_kinesis_video.erl | 8 +- src/aws_kinesis_video_archived_media.erl | 8 +- src/aws_kinesis_video_media.erl | 8 +- src/aws_kinesis_video_signaling.erl | 8 +- src/aws_kinesis_video_webrtc_storage.erl | 8 +- src/aws_lakeformation.erl | 8 +- src/aws_lambda.erl | 8 +- src/aws_lex_model_building.erl | 8 +- src/aws_lex_models_v2.erl | 8 +- src/aws_lex_runtime.erl | 8 +- src/aws_lex_runtime_v2.erl | 8 +- ...ws_license_manager_linux_subscriptions.erl | 8 +- ...aws_license_manager_user_subscriptions.erl | 8 +- src/aws_location.erl | 8 +- src/aws_lookoutmetrics.erl | 8 +- src/aws_lookoutvision.erl | 8 +- src/aws_m2.erl | 8 +- src/aws_macie2.erl | 8 +- src/aws_managedblockchain.erl | 8 +- src/aws_marketplace_catalog.erl | 8 +- src/aws_mediaconnect.erl | 8 +- src/aws_mediaconvert.erl | 8 +- src/aws_medialive.erl | 8 +- src/aws_mediapackage.erl | 8 +- src/aws_mediapackage_vod.erl | 8 +- src/aws_mediastore_data.erl | 8 +- src/aws_mediatailor.erl | 8 +- src/aws_mgn.erl | 8 +- src/aws_migration_hub_refactor_spaces.erl | 8 +- src/aws_migrationhuborchestrator.erl | 8 +- src/aws_migrationhubstrategy.erl | 8 +- src/aws_mobile.erl | 8 +- src/aws_mobile_analytics.erl | 8 +- src/aws_mq.erl | 8 +- src/aws_mwaa.erl | 8 +- src/aws_networkmanager.erl | 8 +- src/aws_nimble.erl | 8 +- src/aws_oam.erl | 8 +- src/aws_omics.erl | 8 +- src/aws_opensearch.erl | 8 +- src/aws_outposts.erl | 8 +- src/aws_panorama.erl | 8 +- src/aws_personalize_events.erl | 8 +- src/aws_personalize_runtime.erl | 8 +- src/aws_pinpoint.erl | 8 +- src/aws_pinpoint_email.erl | 8 +- src/aws_pinpoint_sms_voice.erl | 8 +- src/aws_pipes.erl | 8 +- src/aws_polly.erl | 8 +- src/aws_privatenetworks.erl | 8 +- src/aws_qldb.erl | 8 +- src/aws_quicksight.erl | 8 +- src/aws_ram.erl | 8 +- src/aws_rbin.erl | 8 +- src/aws_rds.erl | 40 --- src/aws_rds_data.erl | 8 +- src/aws_resiliencehub.erl | 8 +- src/aws_resource_explorer_2.erl | 8 +- src/aws_resource_groups.erl | 8 +- src/aws_robomaker.erl | 8 +- src/aws_rolesanywhere.erl | 8 +- src/aws_route53.erl | 8 +- src/aws_route53_recovery_control_config.erl | 10 +- src/aws_route53_recovery_readiness.erl | 8 +- src/aws_rum.erl | 8 +- src/aws_s3.erl | 268 +++++++++--------- src/aws_s3_control.erl | 8 +- src/aws_s3outposts.erl | 8 +- src/aws_sagemaker_a2i_runtime.erl | 8 +- src/aws_sagemaker_edge.erl | 8 +- src/aws_sagemaker_featurestore_runtime.erl | 8 +- src/aws_sagemaker_geospatial.erl | 8 +- src/aws_sagemaker_metrics.erl | 8 +- src/aws_sagemaker_runtime.erl | 8 +- src/aws_savingsplans.erl | 8 +- src/aws_scheduler.erl | 8 +- src/aws_schemas.erl | 8 +- src/aws_securityhub.erl | 8 +- src/aws_securitylake.erl | 8 +- src/aws_serverlessapplicationrepository.erl | 8 +- src/aws_service_catalog_appregistry.erl | 8 +- src/aws_sesv2.erl | 8 +- src/aws_signer.erl | 8 +- src/aws_simspaceweaver.erl | 8 +- src/aws_snow_device_management.erl | 8 +- src/aws_ssm_incidents.erl | 8 +- src/aws_ssm_sap.erl | 8 +- src/aws_sso.erl | 8 +- src/aws_sso_oidc.erl | 8 +- src/aws_support_app.erl | 8 +- src/aws_synthetics.erl | 8 +- src/aws_transcribe_streaming.erl | 8 +- src/aws_wellarchitected.erl | 8 +- src/aws_wisdom.erl | 8 +- src/aws_workdocs.erl | 8 +- src/aws_worklink.erl | 8 +- src/aws_workmailmessageflow.erl | 8 +- src/aws_workspaces_web.erl | 8 +- src/aws_xray.erl | 8 +- 191 files changed, 1455 insertions(+), 361 deletions(-) diff --git a/.latest-tag-aws-sdk-go b/.latest-tag-aws-sdk-go index ad1e1101..fcf98e22 100644 --- a/.latest-tag-aws-sdk-go +++ b/.latest-tag-aws-sdk-go @@ -1 +1 @@ -v1.44.168 +v1.44.169 diff --git a/src/aws_accessanalyzer.erl b/src/aws_accessanalyzer.erl index 4652c178..a20efddb 100644 --- a/src/aws_accessanalyzer.erl +++ b/src/aws_accessanalyzer.erl @@ -872,7 +872,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_account.erl b/src/aws_account.erl index 0339cd5f..3d1fbec0 100644 --- a/src/aws_account.erl +++ b/src/aws_account.erl @@ -236,7 +236,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_amp.erl b/src/aws_amp.erl index 54c6c978..9ba200c5 100644 --- a/src/aws_amp.erl +++ b/src/aws_amp.erl @@ -622,7 +622,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_amplify.erl b/src/aws_amplify.erl index a8e75172..ea6cdf2a 100644 --- a/src/aws_amplify.erl +++ b/src/aws_amplify.erl @@ -1064,7 +1064,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_amplifybackend.erl b/src/aws_amplifybackend.erl index eb305c4b..ff8bafa0 100644 --- a/src/aws_amplifybackend.erl +++ b/src/aws_amplifybackend.erl @@ -852,7 +852,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_amplifyuibuilder.erl b/src/aws_amplifyuibuilder.erl index cdace204..e238ce01 100644 --- a/src/aws_amplifyuibuilder.erl +++ b/src/aws_amplifyuibuilder.erl @@ -685,7 +685,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_api_gateway.erl b/src/aws_api_gateway.erl index 013d943b..4aafaf59 100644 --- a/src/aws_api_gateway.erl +++ b/src/aws_api_gateway.erl @@ -3343,7 +3343,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_apigatewaymanagementapi.erl b/src/aws_apigatewaymanagementapi.erl index 8cbf520d..33720138 100644 --- a/src/aws_apigatewaymanagementapi.erl +++ b/src/aws_apigatewaymanagementapi.erl @@ -155,7 +155,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_apigatewayv2.erl b/src/aws_apigatewayv2.erl index 0a606ddb..6d342cc7 100644 --- a/src/aws_apigatewayv2.erl +++ b/src/aws_apigatewayv2.erl @@ -1976,7 +1976,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_app_mesh.erl b/src/aws_app_mesh.erl index e4af6bf5..cae0a36d 100644 --- a/src/aws_app_mesh.erl +++ b/src/aws_app_mesh.erl @@ -1243,7 +1243,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_appconfig.erl b/src/aws_appconfig.erl index 9026526c..aa3a221c 100644 --- a/src/aws_appconfig.erl +++ b/src/aws_appconfig.erl @@ -1469,7 +1469,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_appconfigdata.erl b/src/aws_appconfigdata.erl index 60baa3e8..a42a0293 100644 --- a/src/aws_appconfigdata.erl +++ b/src/aws_appconfigdata.erl @@ -208,7 +208,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_appflow.erl b/src/aws_appflow.erl index ca0af3d4..d567558d 100644 --- a/src/aws_appflow.erl +++ b/src/aws_appflow.erl @@ -745,7 +745,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_appintegrations.erl b/src/aws_appintegrations.erl index 82b0ed0a..d7f913c1 100644 --- a/src/aws_appintegrations.erl +++ b/src/aws_appintegrations.erl @@ -519,7 +519,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_applicationcostprofiler.erl b/src/aws_applicationcostprofiler.erl index c7a5415f..f0bfad6c 100644 --- a/src/aws_applicationcostprofiler.erl +++ b/src/aws_applicationcostprofiler.erl @@ -251,7 +251,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_appsync.erl b/src/aws_appsync.erl index da2ffb94..d30b0c08 100644 --- a/src/aws_appsync.erl +++ b/src/aws_appsync.erl @@ -1452,7 +1452,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_arc_zonal_shift.erl b/src/aws_arc_zonal_shift.erl index b7435127..1351d4ac 100644 --- a/src/aws_arc_zonal_shift.erl +++ b/src/aws_arc_zonal_shift.erl @@ -306,7 +306,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_auditmanager.erl b/src/aws_auditmanager.erl index 1c6f5321..4d9aafad 100644 --- a/src/aws_auditmanager.erl +++ b/src/aws_auditmanager.erl @@ -1956,7 +1956,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_backup.erl b/src/aws_backup.erl index c58c4f8a..fe0bf180 100644 --- a/src/aws_backup.erl +++ b/src/aws_backup.erl @@ -2228,7 +2228,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_backupstorage.erl b/src/aws_backupstorage.erl index a3a1e232..bc1106df 100644 --- a/src/aws_backupstorage.erl +++ b/src/aws_backupstorage.erl @@ -369,7 +369,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_batch.erl b/src/aws_batch.erl index 1db0bcbd..67cfee33 100644 --- a/src/aws_batch.erl +++ b/src/aws_batch.erl @@ -864,7 +864,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_billingconductor.erl b/src/aws_billingconductor.erl index c2bad4d6..d5c0a2a7 100644 --- a/src/aws_billingconductor.erl +++ b/src/aws_billingconductor.erl @@ -919,7 +919,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_braket.erl b/src/aws_braket.erl index 5e5e5759..de05635e 100644 --- a/src/aws_braket.erl +++ b/src/aws_braket.erl @@ -420,7 +420,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_chime.erl b/src/aws_chime.erl index 27e53295..fdaa994d 100644 --- a/src/aws_chime.erl +++ b/src/aws_chime.erl @@ -5787,7 +5787,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_chime_sdk_identity.erl b/src/aws_chime_sdk_identity.erl index 83c6a0d1..1ecf42a4 100644 --- a/src/aws_chime_sdk_identity.erl +++ b/src/aws_chime_sdk_identity.erl @@ -747,7 +747,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_chime_sdk_media_pipelines.erl b/src/aws_chime_sdk_media_pipelines.erl index 21efc00a..63e1cfe4 100644 --- a/src/aws_chime_sdk_media_pipelines.erl +++ b/src/aws_chime_sdk_media_pipelines.erl @@ -398,7 +398,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_chime_sdk_meetings.erl b/src/aws_chime_sdk_meetings.erl index e056dcc5..815af198 100644 --- a/src/aws_chime_sdk_meetings.erl +++ b/src/aws_chime_sdk_meetings.erl @@ -607,7 +607,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_chime_sdk_messaging.erl b/src/aws_chime_sdk_messaging.erl index 6c9697ec..850b4745 100644 --- a/src/aws_chime_sdk_messaging.erl +++ b/src/aws_chime_sdk_messaging.erl @@ -1778,7 +1778,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_chime_sdk_voice.erl b/src/aws_chime_sdk_voice.erl index 6d237a01..87d7353e 100644 --- a/src/aws_chime_sdk_voice.erl +++ b/src/aws_chime_sdk_voice.erl @@ -2007,7 +2007,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_clouddirectory.erl b/src/aws_clouddirectory.erl index a582bc6d..dd695d3e 100644 --- a/src/aws_clouddirectory.erl +++ b/src/aws_clouddirectory.erl @@ -2012,7 +2012,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_cloudfront.erl b/src/aws_cloudfront.erl index 846bd70f..d31518ae 100644 --- a/src/aws_cloudfront.erl +++ b/src/aws_cloudfront.erl @@ -4563,7 +4563,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> aws_util:decode_xml(Body); + true -> + try + aws_util:decode_xml(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_cloudsearch_domain.erl b/src/aws_cloudsearch_domain.erl index f2cad02f..cb3570e8 100644 --- a/src/aws_cloudsearch_domain.erl +++ b/src/aws_cloudsearch_domain.erl @@ -243,7 +243,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_codeartifact.erl b/src/aws_codeartifact.erl index 0a8a4aa3..f5fcfb1f 100644 --- a/src/aws_codeartifact.erl +++ b/src/aws_codeartifact.erl @@ -1520,7 +1520,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_codeguru_reviewer.erl b/src/aws_codeguru_reviewer.erl index 09d5e96e..60834c31 100644 --- a/src/aws_codeguru_reviewer.erl +++ b/src/aws_codeguru_reviewer.erl @@ -523,7 +523,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_codeguruprofiler.erl b/src/aws_codeguruprofiler.erl index f96e7073..5fd3e81a 100644 --- a/src/aws_codeguruprofiler.erl +++ b/src/aws_codeguruprofiler.erl @@ -839,7 +839,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_codestar_notifications.erl b/src/aws_codestar_notifications.erl index 028a3c41..35abd96d 100644 --- a/src/aws_codestar_notifications.erl +++ b/src/aws_codestar_notifications.erl @@ -468,7 +468,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_cognito_sync.erl b/src/aws_cognito_sync.erl index 510f2291..311963dd 100644 --- a/src/aws_cognito_sync.erl +++ b/src/aws_cognito_sync.erl @@ -647,7 +647,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_connect.erl b/src/aws_connect.erl index c7fd8f04..d16b8c32 100644 --- a/src/aws_connect.erl +++ b/src/aws_connect.erl @@ -5204,7 +5204,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_connect_contact_lens.erl b/src/aws_connect_contact_lens.erl index 652fbc79..f7a0597e 100644 --- a/src/aws_connect_contact_lens.erl +++ b/src/aws_connect_contact_lens.erl @@ -108,7 +108,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_connectcampaigns.erl b/src/aws_connectcampaigns.erl index a8b5ac4e..0c775da7 100644 --- a/src/aws_connectcampaigns.erl +++ b/src/aws_connectcampaigns.erl @@ -641,7 +641,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_connectcases.erl b/src/aws_connectcases.erl index bc338043..5ffe3bc5 100644 --- a/src/aws_connectcases.erl +++ b/src/aws_connectcases.erl @@ -893,7 +893,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_connectparticipant.erl b/src/aws_connectparticipant.erl index b972c568..4492e4a6 100644 --- a/src/aws_connectparticipant.erl +++ b/src/aws_connectparticipant.erl @@ -372,7 +372,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_controltower.erl b/src/aws_controltower.erl index 80bcfe3e..7be555fc 100644 --- a/src/aws_controltower.erl +++ b/src/aws_controltower.erl @@ -244,7 +244,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_customer_profiles.erl b/src/aws_customer_profiles.erl index 2c1bd171..2340052a 100644 --- a/src/aws_customer_profiles.erl +++ b/src/aws_customer_profiles.erl @@ -1300,7 +1300,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_databrew.erl b/src/aws_databrew.erl index 5f4e1565..2fd8f441 100644 --- a/src/aws_databrew.erl +++ b/src/aws_databrew.erl @@ -1283,7 +1283,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_dataexchange.erl b/src/aws_dataexchange.erl index feefb478..59403f2e 100644 --- a/src/aws_dataexchange.erl +++ b/src/aws_dataexchange.erl @@ -881,7 +881,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_detective.erl b/src/aws_detective.erl index 70e29976..b2b54f99 100644 --- a/src/aws_detective.erl +++ b/src/aws_detective.erl @@ -930,7 +930,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_devops_guru.erl b/src/aws_devops_guru.erl index 453eec54..f70e68b5 100644 --- a/src/aws_devops_guru.erl +++ b/src/aws_devops_guru.erl @@ -1016,7 +1016,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_dlm.erl b/src/aws_dlm.erl index 633b8055..463d37fd 100644 --- a/src/aws_dlm.erl +++ b/src/aws_dlm.erl @@ -307,7 +307,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_docdb_elastic.erl b/src/aws_docdb_elastic.erl index 3d089e3d..bfdc76aa 100644 --- a/src/aws_docdb_elastic.erl +++ b/src/aws_docdb_elastic.erl @@ -419,7 +419,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_drs.erl b/src/aws_drs.erl index 5197bb82..bbff0120 100644 --- a/src/aws_drs.erl +++ b/src/aws_drs.erl @@ -1037,7 +1037,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_ebs.erl b/src/aws_ebs.erl index d1f61241..7c61e838 100644 --- a/src/aws_ebs.erl +++ b/src/aws_ebs.erl @@ -331,7 +331,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_efs.erl b/src/aws_efs.erl index 8197868e..127fe941 100644 --- a/src/aws_efs.erl +++ b/src/aws_efs.erl @@ -1435,7 +1435,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_eks.erl b/src/aws_eks.erl index b3997a0b..bcdbfa9b 100644 --- a/src/aws_eks.erl +++ b/src/aws_eks.erl @@ -1268,7 +1268,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_elastic_inference.erl b/src/aws_elastic_inference.erl index ada82f64..d7a23f54 100644 --- a/src/aws_elastic_inference.erl +++ b/src/aws_elastic_inference.erl @@ -228,7 +228,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_elastic_transcoder.erl b/src/aws_elastic_transcoder.erl index 56462afe..625c1651 100644 --- a/src/aws_elastic_transcoder.erl +++ b/src/aws_elastic_transcoder.erl @@ -600,7 +600,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_elasticsearch.erl b/src/aws_elasticsearch.erl index 985c8ca6..a7a9ae3a 100644 --- a/src/aws_elasticsearch.erl +++ b/src/aws_elasticsearch.erl @@ -1490,7 +1490,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_emr_containers.erl b/src/aws_emr_containers.erl index 891bc6b0..3998bdc3 100644 --- a/src/aws_emr_containers.erl +++ b/src/aws_emr_containers.erl @@ -698,7 +698,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_emr_serverless.erl b/src/aws_emr_serverless.erl index c546875a..fc9736f8 100644 --- a/src/aws_emr_serverless.erl +++ b/src/aws_emr_serverless.erl @@ -507,7 +507,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_evidently.erl b/src/aws_evidently.erl index 45ca35ae..36d0dc7d 100644 --- a/src/aws_evidently.erl +++ b/src/aws_evidently.erl @@ -1300,7 +1300,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_finspace.erl b/src/aws_finspace.erl index 905218cf..755b00b0 100644 --- a/src/aws_finspace.erl +++ b/src/aws_finspace.erl @@ -282,7 +282,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_finspace_data.erl b/src/aws_finspace_data.erl index 21d04d58..757a7c04 100644 --- a/src/aws_finspace_data.erl +++ b/src/aws_finspace_data.erl @@ -930,7 +930,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_fis.erl b/src/aws_fis.erl index 0b04ef23..7e265016 100644 --- a/src/aws_fis.erl +++ b/src/aws_fis.erl @@ -522,7 +522,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_gamesparks.erl b/src/aws_gamesparks.erl index 449af3b1..7b4987ee 100644 --- a/src/aws_gamesparks.erl +++ b/src/aws_gamesparks.erl @@ -998,7 +998,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_glacier.erl b/src/aws_glacier.erl index 83f0584f..126ffe79 100644 --- a/src/aws_glacier.erl +++ b/src/aws_glacier.erl @@ -1798,7 +1798,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_grafana.erl b/src/aws_grafana.erl index 2f60731b..87d5f663 100644 --- a/src/aws_grafana.erl +++ b/src/aws_grafana.erl @@ -607,7 +607,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_greengrass.erl b/src/aws_greengrass.erl index b2e3979a..986d2409 100644 --- a/src/aws_greengrass.erl +++ b/src/aws_greengrass.erl @@ -2678,7 +2678,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_greengrassv2.erl b/src/aws_greengrassv2.erl index 77c10cda..9d4a73ad 100644 --- a/src/aws_greengrassv2.erl +++ b/src/aws_greengrassv2.erl @@ -1120,7 +1120,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_groundstation.erl b/src/aws_groundstation.erl index b56cf90f..bfb53246 100644 --- a/src/aws_groundstation.erl +++ b/src/aws_groundstation.erl @@ -892,7 +892,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_guardduty.erl b/src/aws_guardduty.erl index ab38ad5d..17c5f729 100644 --- a/src/aws_guardduty.erl +++ b/src/aws_guardduty.erl @@ -1879,7 +1879,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_honeycode.erl b/src/aws_honeycode.erl index ef9522fd..6badd0f9 100644 --- a/src/aws_honeycode.erl +++ b/src/aws_honeycode.erl @@ -525,7 +525,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_imagebuilder.erl b/src/aws_imagebuilder.erl index b4a28ea6..74b112c6 100644 --- a/src/aws_imagebuilder.erl +++ b/src/aws_imagebuilder.erl @@ -1507,7 +1507,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_inspector2.erl b/src/aws_inspector2.erl index c18b9612..8eb3a428 100644 --- a/src/aws_inspector2.erl +++ b/src/aws_inspector2.erl @@ -896,7 +896,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_iot.erl b/src/aws_iot.erl index c8f6e29f..6ade4d60 100644 --- a/src/aws_iot.erl +++ b/src/aws_iot.erl @@ -7467,7 +7467,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_iot_1click_devices.erl b/src/aws_iot_1click_devices.erl index b655b690..ad90fcc6 100644 --- a/src/aws_iot_1click_devices.erl +++ b/src/aws_iot_1click_devices.erl @@ -452,7 +452,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_iot_1click_projects.erl b/src/aws_iot_1click_projects.erl index 5b3f2ce7..598308e0 100644 --- a/src/aws_iot_1click_projects.erl +++ b/src/aws_iot_1click_projects.erl @@ -512,7 +512,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_iot_data_plane.erl b/src/aws_iot_data_plane.erl index 5d824de5..63015819 100644 --- a/src/aws_iot_data_plane.erl +++ b/src/aws_iot_data_plane.erl @@ -338,7 +338,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_iot_events.erl b/src/aws_iot_events.erl index 1bfb493a..3e0948fb 100644 --- a/src/aws_iot_events.erl +++ b/src/aws_iot_events.erl @@ -830,7 +830,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_iot_events_data.erl b/src/aws_iot_events_data.erl index 083b264f..0922a269 100644 --- a/src/aws_iot_events_data.erl +++ b/src/aws_iot_events_data.erl @@ -426,7 +426,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_iot_jobs_data_plane.erl b/src/aws_iot_jobs_data_plane.erl index 383a0836..92564aa3 100644 --- a/src/aws_iot_jobs_data_plane.erl +++ b/src/aws_iot_jobs_data_plane.erl @@ -198,7 +198,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_iot_roborunner.erl b/src/aws_iot_roborunner.erl index 45397130..dc1fb6e9 100644 --- a/src/aws_iot_roborunner.erl +++ b/src/aws_iot_roborunner.erl @@ -622,7 +622,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_iot_wireless.erl b/src/aws_iot_wireless.erl index 66d800e1..dbd16658 100644 --- a/src/aws_iot_wireless.erl +++ b/src/aws_iot_wireless.erl @@ -2848,7 +2848,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_iotanalytics.erl b/src/aws_iotanalytics.erl index 8ecab4c9..f593de74 100644 --- a/src/aws_iotanalytics.erl +++ b/src/aws_iotanalytics.erl @@ -1049,7 +1049,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_iotdeviceadvisor.erl b/src/aws_iotdeviceadvisor.erl index 31ad89f7..0c744d27 100644 --- a/src/aws_iotdeviceadvisor.erl +++ b/src/aws_iotdeviceadvisor.erl @@ -494,7 +494,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_iotfleethub.erl b/src/aws_iotfleethub.erl index 0d510a7e..ba0141f9 100644 --- a/src/aws_iotfleethub.erl +++ b/src/aws_iotfleethub.erl @@ -315,7 +315,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_iotsitewise.erl b/src/aws_iotsitewise.erl index 68cea217..dbc58a11 100644 --- a/src/aws_iotsitewise.erl +++ b/src/aws_iotsitewise.erl @@ -2393,7 +2393,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_iottwinmaker.erl b/src/aws_iottwinmaker.erl index 7d6296b1..84f945cf 100644 --- a/src/aws_iottwinmaker.erl +++ b/src/aws_iottwinmaker.erl @@ -952,7 +952,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_ivs.erl b/src/aws_ivs.erl index 95d67a52..11258bcd 100644 --- a/src/aws_ivs.erl +++ b/src/aws_ivs.erl @@ -1085,7 +1085,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_ivschat.erl b/src/aws_ivschat.erl index 31c5e5ae..42ee9502 100644 --- a/src/aws_ivschat.erl +++ b/src/aws_ivschat.erl @@ -700,7 +700,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_kafka.erl b/src/aws_kafka.erl index 6388494f..629dab0d 100644 --- a/src/aws_kafka.erl +++ b/src/aws_kafka.erl @@ -1060,7 +1060,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_kafkaconnect.erl b/src/aws_kafkaconnect.erl index cf476184..ec6fcfaa 100644 --- a/src/aws_kafkaconnect.erl +++ b/src/aws_kafkaconnect.erl @@ -402,7 +402,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_kinesis_video.erl b/src/aws_kinesis_video.erl index 995fb860..deec5a06 100644 --- a/src/aws_kinesis_video.erl +++ b/src/aws_kinesis_video.erl @@ -950,7 +950,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_kinesis_video_archived_media.erl b/src/aws_kinesis_video_archived_media.erl index b270a8d8..07bafdcc 100644 --- a/src/aws_kinesis_video_archived_media.erl +++ b/src/aws_kinesis_video_archived_media.erl @@ -613,7 +613,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_kinesis_video_media.erl b/src/aws_kinesis_video_media.erl index f25b9b1d..2f4ec27a 100644 --- a/src/aws_kinesis_video_media.erl +++ b/src/aws_kinesis_video_media.erl @@ -154,7 +154,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_kinesis_video_signaling.erl b/src/aws_kinesis_video_signaling.erl index cbebd94b..8acdc12e 100644 --- a/src/aws_kinesis_video_signaling.erl +++ b/src/aws_kinesis_video_signaling.erl @@ -149,7 +149,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_kinesis_video_webrtc_storage.erl b/src/aws_kinesis_video_webrtc_storage.erl index 2989be7e..040393e6 100644 --- a/src/aws_kinesis_video_webrtc_storage.erl +++ b/src/aws_kinesis_video_webrtc_storage.erl @@ -119,7 +119,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_lakeformation.erl b/src/aws_lakeformation.erl index 27a8456b..55556994 100644 --- a/src/aws_lakeformation.erl +++ b/src/aws_lakeformation.erl @@ -1350,7 +1350,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_lambda.erl b/src/aws_lambda.erl index cb3714ca..8eacce65 100644 --- a/src/aws_lambda.erl +++ b/src/aws_lambda.erl @@ -2334,7 +2334,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_lex_model_building.erl b/src/aws_lex_model_building.erl index 8c63e8dc..e0439961 100644 --- a/src/aws_lex_model_building.erl +++ b/src/aws_lex_model_building.erl @@ -1597,7 +1597,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_lex_models_v2.erl b/src/aws_lex_models_v2.erl index 9daed47b..38b15fd6 100644 --- a/src/aws_lex_models_v2.erl +++ b/src/aws_lex_models_v2.erl @@ -2061,7 +2061,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_lex_runtime.erl b/src/aws_lex_runtime.erl index af931e9e..b039c8cf 100644 --- a/src/aws_lex_runtime.erl +++ b/src/aws_lex_runtime.erl @@ -395,7 +395,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_lex_runtime_v2.erl b/src/aws_lex_runtime_v2.erl index cb6a6d53..385e7d4d 100644 --- a/src/aws_lex_runtime_v2.erl +++ b/src/aws_lex_runtime_v2.erl @@ -417,7 +417,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_license_manager_linux_subscriptions.erl b/src/aws_license_manager_linux_subscriptions.erl index 1fc7f944..125a0f4c 100644 --- a/src/aws_license_manager_linux_subscriptions.erl +++ b/src/aws_license_manager_linux_subscriptions.erl @@ -177,7 +177,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_license_manager_user_subscriptions.erl b/src/aws_license_manager_user_subscriptions.erl index c9e9957a..dfe569e5 100644 --- a/src/aws_license_manager_user_subscriptions.erl +++ b/src/aws_license_manager_user_subscriptions.erl @@ -368,7 +368,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_location.erl b/src/aws_location.erl index 91b35c1b..7d0e0edb 100644 --- a/src/aws_location.erl +++ b/src/aws_location.erl @@ -1722,7 +1722,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_lookoutmetrics.erl b/src/aws_lookoutmetrics.erl index 38a08955..0f001685 100644 --- a/src/aws_lookoutmetrics.erl +++ b/src/aws_lookoutmetrics.erl @@ -859,7 +859,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_lookoutvision.erl b/src/aws_lookoutvision.erl index 91f15e3c..6bd4d18a 100644 --- a/src/aws_lookoutvision.erl +++ b/src/aws_lookoutvision.erl @@ -918,7 +918,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_m2.erl b/src/aws_m2.erl index 0d224212..9b5540a1 100644 --- a/src/aws_m2.erl +++ b/src/aws_m2.erl @@ -995,7 +995,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_macie2.erl b/src/aws_macie2.erl index d950b359..426d9995 100644 --- a/src/aws_macie2.erl +++ b/src/aws_macie2.erl @@ -2205,7 +2205,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_managedblockchain.erl b/src/aws_managedblockchain.erl index 47f440bd..f19171a1 100644 --- a/src/aws_managedblockchain.erl +++ b/src/aws_managedblockchain.erl @@ -954,7 +954,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_marketplace_catalog.erl b/src/aws_marketplace_catalog.erl index 35cbc18e..4e26f0b3 100644 --- a/src/aws_marketplace_catalog.erl +++ b/src/aws_marketplace_catalog.erl @@ -348,7 +348,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_mediaconnect.erl b/src/aws_mediaconnect.erl index d7025d55..58f71587 100644 --- a/src/aws_mediaconnect.erl +++ b/src/aws_mediaconnect.erl @@ -916,7 +916,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_mediaconvert.erl b/src/aws_mediaconvert.erl index 1e8d0104..5e191bac 100644 --- a/src/aws_mediaconvert.erl +++ b/src/aws_mediaconvert.erl @@ -858,7 +858,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_medialive.erl b/src/aws_medialive.erl index 858f101d..88ce642c 100644 --- a/src/aws_medialive.erl +++ b/src/aws_medialive.erl @@ -1694,7 +1694,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_mediapackage.erl b/src/aws_mediapackage.erl index 882f8b99..bf169cb1 100644 --- a/src/aws_mediapackage.erl +++ b/src/aws_mediapackage.erl @@ -577,7 +577,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_mediapackage_vod.erl b/src/aws_mediapackage_vod.erl index e255e9aa..9f147688 100644 --- a/src/aws_mediapackage_vod.erl +++ b/src/aws_mediapackage_vod.erl @@ -532,7 +532,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_mediastore_data.erl b/src/aws_mediastore_data.erl index 3cae86ae..86579c96 100644 --- a/src/aws_mediastore_data.erl +++ b/src/aws_mediastore_data.erl @@ -267,7 +267,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_mediatailor.erl b/src/aws_mediatailor.erl index cfac9eda..97682cf4 100644 --- a/src/aws_mediatailor.erl +++ b/src/aws_mediatailor.erl @@ -1277,7 +1277,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_mgn.erl b/src/aws_mgn.erl index 0b6ee83a..a9f276d1 100644 --- a/src/aws_mgn.erl +++ b/src/aws_mgn.erl @@ -1525,7 +1525,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_migration_hub_refactor_spaces.erl b/src/aws_migration_hub_refactor_spaces.erl index 740a34eb..290a99f4 100644 --- a/src/aws_migration_hub_refactor_spaces.erl +++ b/src/aws_migration_hub_refactor_spaces.erl @@ -850,7 +850,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_migrationhuborchestrator.erl b/src/aws_migrationhuborchestrator.erl index b8404de9..98908f15 100644 --- a/src/aws_migrationhuborchestrator.erl +++ b/src/aws_migrationhuborchestrator.erl @@ -863,7 +863,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_migrationhubstrategy.erl b/src/aws_migrationhubstrategy.erl index fb1e9883..6d04a0f5 100644 --- a/src/aws_migrationhubstrategy.erl +++ b/src/aws_migrationhubstrategy.erl @@ -637,7 +637,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_mobile.erl b/src/aws_mobile.erl index 142a96e0..740c5b54 100644 --- a/src/aws_mobile.erl +++ b/src/aws_mobile.erl @@ -331,7 +331,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_mobile_analytics.erl b/src/aws_mobile_analytics.erl index d1ecd19a..79668bd5 100644 --- a/src/aws_mobile_analytics.erl +++ b/src/aws_mobile_analytics.erl @@ -105,7 +105,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_mq.erl b/src/aws_mq.erl index 6a72cd57..9a9070cc 100644 --- a/src/aws_mq.erl +++ b/src/aws_mq.erl @@ -719,7 +719,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_mwaa.erl b/src/aws_mwaa.erl index 408f4dc0..52ecff3f 100644 --- a/src/aws_mwaa.erl +++ b/src/aws_mwaa.erl @@ -418,7 +418,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_networkmanager.erl b/src/aws_networkmanager.erl index 143bdcde..ed0920f5 100644 --- a/src/aws_networkmanager.erl +++ b/src/aws_networkmanager.erl @@ -2532,7 +2532,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_nimble.erl b/src/aws_nimble.erl index 2f492715..3e6cac34 100644 --- a/src/aws_nimble.erl +++ b/src/aws_nimble.erl @@ -1528,7 +1528,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_oam.erl b/src/aws_oam.erl index 28737e17..51b0dc67 100644 --- a/src/aws_oam.erl +++ b/src/aws_oam.erl @@ -566,7 +566,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_omics.erl b/src/aws_omics.erl index 421bb3c2..33fbe4a0 100644 --- a/src/aws_omics.erl +++ b/src/aws_omics.erl @@ -1824,7 +1824,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_opensearch.erl b/src/aws_opensearch.erl index 7b8091bd..bf579618 100644 --- a/src/aws_opensearch.erl +++ b/src/aws_opensearch.erl @@ -1507,7 +1507,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_outposts.erl b/src/aws_outposts.erl index be2fbcd5..2ab62bcf 100644 --- a/src/aws_outposts.erl +++ b/src/aws_outposts.erl @@ -847,7 +847,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_panorama.erl b/src/aws_panorama.erl index 35247d82..27c51d81 100644 --- a/src/aws_panorama.erl +++ b/src/aws_panorama.erl @@ -1030,7 +1030,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_personalize_events.erl b/src/aws_personalize_events.erl index e7630926..1ac7732f 100644 --- a/src/aws_personalize_events.erl +++ b/src/aws_personalize_events.erl @@ -157,7 +157,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_personalize_runtime.erl b/src/aws_personalize_runtime.erl index 7b4fb620..aca6d282 100644 --- a/src/aws_personalize_runtime.erl +++ b/src/aws_personalize_runtime.erl @@ -144,7 +144,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_pinpoint.erl b/src/aws_pinpoint.erl index 8cf921f0..c4d1931f 100644 --- a/src/aws_pinpoint.erl +++ b/src/aws_pinpoint.erl @@ -3345,7 +3345,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_pinpoint_email.erl b/src/aws_pinpoint_email.erl index afc81cd0..1921b52d 100644 --- a/src/aws_pinpoint_email.erl +++ b/src/aws_pinpoint_email.erl @@ -1425,7 +1425,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_pinpoint_sms_voice.erl b/src/aws_pinpoint_sms_voice.erl index c820ecf2..9f8cae25 100644 --- a/src/aws_pinpoint_sms_voice.erl +++ b/src/aws_pinpoint_sms_voice.erl @@ -289,7 +289,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_pipes.erl b/src/aws_pipes.erl index 02ec4dcb..8dd17313 100644 --- a/src/aws_pipes.erl +++ b/src/aws_pipes.erl @@ -383,7 +383,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_polly.erl b/src/aws_polly.erl index 87eb8198..167ded3b 100644 --- a/src/aws_polly.erl +++ b/src/aws_polly.erl @@ -405,7 +405,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_privatenetworks.erl b/src/aws_privatenetworks.erl index 395103c6..228f0aa2 100644 --- a/src/aws_privatenetworks.erl +++ b/src/aws_privatenetworks.erl @@ -753,7 +753,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_qldb.erl b/src/aws_qldb.erl index 46d87ead..d71ba328 100644 --- a/src/aws_qldb.erl +++ b/src/aws_qldb.erl @@ -724,7 +724,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_quicksight.erl b/src/aws_quicksight.erl index 1dad782e..5117cdbf 100644 --- a/src/aws_quicksight.erl +++ b/src/aws_quicksight.erl @@ -3938,7 +3938,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_ram.erl b/src/aws_ram.erl index ecc44057..5c9d2e0a 100644 --- a/src/aws_ram.erl +++ b/src/aws_ram.erl @@ -789,7 +789,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_rbin.erl b/src/aws_rbin.erl index cacc5b4f..f77bc963 100644 --- a/src/aws_rbin.erl +++ b/src/aws_rbin.erl @@ -359,7 +359,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_rds.erl b/src/aws_rds.erl index e6472f69..76ac235b 100644 --- a/src/aws_rds.erl +++ b/src/aws_rds.erl @@ -574,46 +574,6 @@ create_blue_green_deployment(Client, Input, Options) request(Client, <<"CreateBlueGreenDeployment">>, Input, Options). %% @doc Creates a custom DB engine version (CEV). -%% -%% A CEV is a binary volume snapshot of a database engine and specific AMI. -%% The supported engines are the following: -%% -%% Amazon RDS, which is a fully managed service, supplies the -%% Amazon Machine Image (AMI) and database software. The Amazon RDS database -%% software is preinstalled, so you need only select a DB engine and version, -%% and create your database. With Amazon RDS Custom for Oracle, you upload -%% your database installation files in Amazon S3. -%% -%% When you create a custom engine version, you specify the files in a JSON -%% document called a CEV manifest. This document describes installation .zip -%% files stored in Amazon S3. RDS Custom creates your CEV from the -%% installation files that you provided. This service model is called Bring -%% Your Own Media (BYOM). -%% -%% Creation takes approximately two hours. If creation fails, RDS Custom -%% issues `RDS-EVENT-0196' with the message `Creation failed for custom -%% engine version', and includes details about the failure. For example, the -%% event prints missing files. -%% -%% After you create the CEV, it is available for use. You can create multiple -%% CEVs, and create multiple RDS Custom instances from any CEV. You can also -%% change the status of a CEV to make it available or inactive. -%% -%% The MediaImport service that imports files from Amazon S3 to create CEVs -%% isn't integrated with Amazon Web Services CloudTrail. If you turn on data -%% logging for Amazon RDS in CloudTrail, calls to the -%% `CreateCustomDbEngineVersion' event aren't logged. However, you might see -%% calls from the API gateway that accesses your Amazon S3 bucket. These -%% calls originate from the MediaImport service for the -%% `CreateCustomDbEngineVersion' event. -%% -%% For more information, see Creating a CEV in the Amazon RDS User Guide. create_custom_db_engine_version(Client, Input) when is_map(Client), is_map(Input) -> create_custom_db_engine_version(Client, Input, []). diff --git a/src/aws_rds_data.erl b/src/aws_rds_data.erl index bd6ef911..7c43a365 100644 --- a/src/aws_rds_data.erl +++ b/src/aws_rds_data.erl @@ -277,7 +277,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_resiliencehub.erl b/src/aws_resiliencehub.erl index 7bd0dade..cae5b046 100644 --- a/src/aws_resiliencehub.erl +++ b/src/aws_resiliencehub.erl @@ -1149,7 +1149,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_resource_explorer_2.erl b/src/aws_resource_explorer_2.erl index 0c96074b..f3a93acc 100644 --- a/src/aws_resource_explorer_2.erl +++ b/src/aws_resource_explorer_2.erl @@ -767,7 +767,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_resource_groups.erl b/src/aws_resource_groups.erl index 639c70c2..af1f79e0 100644 --- a/src/aws_resource_groups.erl +++ b/src/aws_resource_groups.erl @@ -692,7 +692,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_robomaker.erl b/src/aws_robomaker.erl index cd0213e8..63e5ae91 100644 --- a/src/aws_robomaker.erl +++ b/src/aws_robomaker.erl @@ -1588,7 +1588,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_rolesanywhere.erl b/src/aws_rolesanywhere.erl index a32852d1..b01e0c42 100644 --- a/src/aws_rolesanywhere.erl +++ b/src/aws_rolesanywhere.erl @@ -881,7 +881,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_route53.erl b/src/aws_route53.erl index 90a8b8e2..d44919bc 100644 --- a/src/aws_route53.erl +++ b/src/aws_route53.erl @@ -3075,7 +3075,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> aws_util:decode_xml(Body); + true -> + try + aws_util:decode_xml(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_route53_recovery_control_config.erl b/src/aws_route53_recovery_control_config.erl index 31af1030..20793369 100644 --- a/src/aws_route53_recovery_control_config.erl +++ b/src/aws_route53_recovery_control_config.erl @@ -167,7 +167,7 @@ create_routing_control(Client, Input0, Options0) -> %% Assertion rule: An assertion rule enforces that, when you change a routing %% control state, that a certain criteria is met. For example, the criteria %% might be that at least one routing control state is On after the -%% transation so that traffic continues to flow to at least one cell for the +%% transaction so that traffic continues to flow to at least one cell for the %% application. This ensures that you avoid a fail-open scenario. %% %% Gating rule: A gating rule lets you configure a gating routing control as @@ -753,7 +753,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_route53_recovery_readiness.erl b/src/aws_route53_recovery_readiness.erl index cba14927..5209902a 100644 --- a/src/aws_route53_recovery_readiness.erl +++ b/src/aws_route53_recovery_readiness.erl @@ -986,7 +986,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_rum.erl b/src/aws_rum.erl index ab378b6e..e39e3d03 100644 --- a/src/aws_rum.erl +++ b/src/aws_rum.erl @@ -649,7 +649,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_s3.erl b/src/aws_s3.erl index 16de33f3..58000a37 100644 --- a/src/aws_s3.erl +++ b/src/aws_s3.erl @@ -639,44 +639,44 @@ copy_object(Client, Bucket, Key, Input0, Options0) -> HeadersMapping = [ - {<<"x-amz-copy-source-if-modified-since">>, <<"CopySourceIfModifiedSince">>}, - {<<"Content-Language">>, <<"ContentLanguage">>}, - {<<"Expires">>, <<"Expires">>}, {<<"x-amz-checksum-algorithm">>, <<"ChecksumAlgorithm">>}, - {<<"x-amz-copy-source-server-side-encryption-customer-key-MD5">>, <<"CopySourceSSECustomerKeyMD5">>}, - {<<"x-amz-object-lock-legal-hold">>, <<"ObjectLockLegalHoldStatus">>}, - {<<"x-amz-copy-source-server-side-encryption-customer-key">>, <<"CopySourceSSECustomerKey">>}, - {<<"x-amz-server-side-encryption-bucket-key-enabled">>, <<"BucketKeyEnabled">>}, - {<<"x-amz-server-side-encryption-customer-key-MD5">>, <<"SSECustomerKeyMD5">>}, + {<<"x-amz-copy-source-server-side-encryption-customer-algorithm">>, <<"CopySourceSSECustomerAlgorithm">>}, + {<<"x-amz-server-side-encryption-customer-key">>, <<"SSECustomerKey">>}, + {<<"x-amz-copy-source">>, <<"CopySource">>}, + {<<"x-amz-grant-full-control">>, <<"GrantFullControl">>}, + {<<"x-amz-acl">>, <<"ACL">>}, {<<"x-amz-object-lock-retain-until-date">>, <<"ObjectLockRetainUntilDate">>}, {<<"x-amz-request-payer">>, <<"RequestPayer">>}, + {<<"x-amz-server-side-encryption-bucket-key-enabled">>, <<"BucketKeyEnabled">>}, + {<<"Content-Type">>, <<"ContentType">>}, + {<<"x-amz-server-side-encryption-customer-key-MD5">>, <<"SSECustomerKeyMD5">>}, + {<<"x-amz-object-lock-legal-hold">>, <<"ObjectLockLegalHoldStatus">>}, + {<<"x-amz-tagging">>, <<"Tagging">>}, {<<"x-amz-expected-bucket-owner">>, <<"ExpectedBucketOwner">>}, - {<<"Content-Disposition">>, <<"ContentDisposition">>}, + {<<"x-amz-copy-source-server-side-encryption-customer-key">>, <<"CopySourceSSECustomerKey">>}, + {<<"x-amz-website-redirect-location">>, <<"WebsiteRedirectLocation">>}, + {<<"Content-Language">>, <<"ContentLanguage">>}, + {<<"x-amz-server-side-encryption-customer-algorithm">>, <<"SSECustomerAlgorithm">>}, {<<"Content-Encoding">>, <<"ContentEncoding">>}, - {<<"x-amz-server-side-encryption">>, <<"ServerSideEncryption">>}, - {<<"x-amz-tagging">>, <<"Tagging">>}, - {<<"x-amz-storage-class">>, <<"StorageClass">>}, + {<<"x-amz-copy-source-server-side-encryption-customer-key-MD5">>, <<"CopySourceSSECustomerKeyMD5">>}, + {<<"x-amz-copy-source-if-match">>, <<"CopySourceIfMatch">>}, {<<"x-amz-copy-source-if-unmodified-since">>, <<"CopySourceIfUnmodifiedSince">>}, - {<<"x-amz-acl">>, <<"ACL">>}, - {<<"Content-Type">>, <<"ContentType">>}, - {<<"x-amz-copy-source">>, <<"CopySource">>}, - {<<"x-amz-object-lock-mode">>, <<"ObjectLockMode">>}, - {<<"x-amz-server-side-encryption-customer-algorithm">>, <<"SSECustomerAlgorithm">>}, + {<<"Expires">>, <<"Expires">>}, {<<"x-amz-grant-write-acp">>, <<"GrantWriteACP">>}, - {<<"x-amz-grant-read-acp">>, <<"GrantReadACP">>}, - {<<"x-amz-grant-full-control">>, <<"GrantFullControl">>}, - {<<"x-amz-server-side-encryption-aws-kms-key-id">>, <<"SSEKMSKeyId">>}, + {<<"x-amz-server-side-encryption-context">>, <<"SSEKMSEncryptionContext">>}, {<<"Cache-Control">>, <<"CacheControl">>}, - {<<"x-amz-tagging-directive">>, <<"TaggingDirective">>}, - {<<"x-amz-server-side-encryption-customer-key">>, <<"SSECustomerKey">>}, - {<<"x-amz-website-redirect-location">>, <<"WebsiteRedirectLocation">>}, - {<<"x-amz-grant-read">>, <<"GrantRead">>}, - {<<"x-amz-copy-source-server-side-encryption-customer-algorithm">>, <<"CopySourceSSECustomerAlgorithm">>}, - {<<"x-amz-copy-source-if-match">>, <<"CopySourceIfMatch">>}, + {<<"x-amz-source-expected-bucket-owner">>, <<"ExpectedSourceBucketOwner">>}, {<<"x-amz-metadata-directive">>, <<"MetadataDirective">>}, + {<<"x-amz-storage-class">>, <<"StorageClass">>}, + {<<"x-amz-copy-source-if-modified-since">>, <<"CopySourceIfModifiedSince">>}, + {<<"x-amz-grant-read">>, <<"GrantRead">>}, + {<<"x-amz-tagging-directive">>, <<"TaggingDirective">>}, + {<<"x-amz-object-lock-mode">>, <<"ObjectLockMode">>}, + {<<"Content-Disposition">>, <<"ContentDisposition">>}, + {<<"x-amz-server-side-encryption">>, <<"ServerSideEncryption">>}, {<<"x-amz-copy-source-if-none-match">>, <<"CopySourceIfNoneMatch">>}, - {<<"x-amz-server-side-encryption-context">>, <<"SSEKMSEncryptionContext">>}, - {<<"x-amz-source-expected-bucket-owner">>, <<"ExpectedSourceBucketOwner">>} + {<<"x-amz-server-side-encryption-aws-kms-key-id">>, <<"SSEKMSKeyId">>}, + {<<"x-amz-grant-read-acp">>, <<"GrantReadACP">>} ], {Headers, Input1} = aws_request:build_headers(HeadersMapping, Input0), @@ -3309,40 +3309,40 @@ get_object(Client, Bucket, Key, QueryMap, HeadersMap, Options0) {ok, Body0, {_, ResponseHeaders, _} = Response} -> ResponseHeadersParams = [ - {<<"ETag">>, <<"ETag">>}, - {<<"Content-Language">>, <<"ContentLanguage">>}, - {<<"Expires">>, <<"Expires">>}, - {<<"x-amz-object-lock-legal-hold">>, <<"ObjectLockLegalHoldStatus">>}, - {<<"x-amz-expiration">>, <<"Expiration">>}, - {<<"x-amz-server-side-encryption-bucket-key-enabled">>, <<"BucketKeyEnabled">>}, + {<<"x-amz-checksum-crc32c">>, <<"ChecksumCRC32C">>}, + {<<"x-amz-delete-marker">>, <<"DeleteMarker">>}, + {<<"x-amz-object-lock-retain-until-date">>, <<"ObjectLockRetainUntilDate">>}, {<<"x-amz-restore">>, <<"Restore">>}, + {<<"x-amz-server-side-encryption-bucket-key-enabled">>, <<"BucketKeyEnabled">>}, + {<<"Content-Type">>, <<"ContentType">>}, {<<"x-amz-server-side-encryption-customer-key-MD5">>, <<"SSECustomerKeyMD5">>}, - {<<"x-amz-object-lock-retain-until-date">>, <<"ObjectLockRetainUntilDate">>}, - {<<"Content-Length">>, <<"ContentLength">>}, - {<<"Content-Disposition">>, <<"ContentDisposition">>}, + {<<"x-amz-object-lock-legal-hold">>, <<"ObjectLockLegalHoldStatus">>}, + {<<"x-amz-version-id">>, <<"VersionId">>}, + {<<"accept-ranges">>, <<"AcceptRanges">>}, + {<<"x-amz-website-redirect-location">>, <<"WebsiteRedirectLocation">>}, + {<<"Content-Language">>, <<"ContentLanguage">>}, + {<<"x-amz-server-side-encryption-customer-algorithm">>, <<"SSECustomerAlgorithm">>}, {<<"Content-Encoding">>, <<"ContentEncoding">>}, - {<<"x-amz-server-side-encryption">>, <<"ServerSideEncryption">>}, {<<"x-amz-checksum-sha256">>, <<"ChecksumSHA256">>}, - {<<"accept-ranges">>, <<"AcceptRanges">>}, + {<<"ETag">>, <<"ETag">>}, + {<<"Last-Modified">>, <<"LastModified">>}, + {<<"Content-Range">>, <<"ContentRange">>}, + {<<"Expires">>, <<"Expires">>}, + {<<"x-amz-tagging-count">>, <<"TagCount">>}, + {<<"x-amz-expiration">>, <<"Expiration">>}, + {<<"x-amz-replication-status">>, <<"ReplicationStatus">>}, + {<<"Cache-Control">>, <<"CacheControl">>}, {<<"x-amz-storage-class">>, <<"StorageClass">>}, - {<<"x-amz-version-id">>, <<"VersionId">>}, - {<<"Content-Type">>, <<"ContentType">>}, + {<<"x-amz-missing-meta">>, <<"MissingMeta">>}, + {<<"Content-Length">>, <<"ContentLength">>}, {<<"x-amz-object-lock-mode">>, <<"ObjectLockMode">>}, - {<<"x-amz-server-side-encryption-customer-algorithm">>, <<"SSECustomerAlgorithm">>}, - {<<"x-amz-delete-marker">>, <<"DeleteMarker">>}, - {<<"x-amz-server-side-encryption-aws-kms-key-id">>, <<"SSEKMSKeyId">>}, - {<<"Cache-Control">>, <<"CacheControl">>}, - {<<"x-amz-mp-parts-count">>, <<"PartsCount">>}, + {<<"Content-Disposition">>, <<"ContentDisposition">>}, {<<"x-amz-request-charged">>, <<"RequestCharged">>}, - {<<"x-amz-website-redirect-location">>, <<"WebsiteRedirectLocation">>}, - {<<"x-amz-checksum-sha1">>, <<"ChecksumSHA1">>}, - {<<"x-amz-checksum-crc32c">>, <<"ChecksumCRC32C">>}, - {<<"Last-Modified">>, <<"LastModified">>}, - {<<"x-amz-missing-meta">>, <<"MissingMeta">>}, + {<<"x-amz-server-side-encryption">>, <<"ServerSideEncryption">>}, + {<<"x-amz-mp-parts-count">>, <<"PartsCount">>}, + {<<"x-amz-server-side-encryption-aws-kms-key-id">>, <<"SSEKMSKeyId">>}, {<<"x-amz-checksum-crc32">>, <<"ChecksumCRC32">>}, - {<<"x-amz-replication-status">>, <<"ReplicationStatus">>}, - {<<"x-amz-tagging-count">>, <<"TagCount">>}, - {<<"Content-Range">>, <<"ContentRange">>} + {<<"x-amz-checksum-sha1">>, <<"ChecksumSHA1">>} ], FoldFun = fun({Name_, Key_}, Acc_) -> case lists:keyfind(Name_, 1, ResponseHeaders) of @@ -4071,39 +4071,39 @@ head_object(Client, Bucket, Key, Input0, Options0) -> Body0 = #{}, ResponseHeadersParams = [ - {<<"ETag">>, <<"ETag">>}, - {<<"Content-Language">>, <<"ContentLanguage">>}, - {<<"Expires">>, <<"Expires">>}, - {<<"x-amz-object-lock-legal-hold">>, <<"ObjectLockLegalHoldStatus">>}, - {<<"x-amz-expiration">>, <<"Expiration">>}, - {<<"x-amz-server-side-encryption-bucket-key-enabled">>, <<"BucketKeyEnabled">>}, + {<<"x-amz-checksum-crc32c">>, <<"ChecksumCRC32C">>}, + {<<"x-amz-delete-marker">>, <<"DeleteMarker">>}, + {<<"x-amz-object-lock-retain-until-date">>, <<"ObjectLockRetainUntilDate">>}, {<<"x-amz-restore">>, <<"Restore">>}, + {<<"x-amz-server-side-encryption-bucket-key-enabled">>, <<"BucketKeyEnabled">>}, + {<<"Content-Type">>, <<"ContentType">>}, {<<"x-amz-server-side-encryption-customer-key-MD5">>, <<"SSECustomerKeyMD5">>}, - {<<"x-amz-object-lock-retain-until-date">>, <<"ObjectLockRetainUntilDate">>}, - {<<"Content-Length">>, <<"ContentLength">>}, - {<<"Content-Disposition">>, <<"ContentDisposition">>}, - {<<"Content-Encoding">>, <<"ContentEncoding">>}, - {<<"x-amz-server-side-encryption">>, <<"ServerSideEncryption">>}, - {<<"x-amz-checksum-sha256">>, <<"ChecksumSHA256">>}, - {<<"accept-ranges">>, <<"AcceptRanges">>}, - {<<"x-amz-storage-class">>, <<"StorageClass">>}, + {<<"x-amz-object-lock-legal-hold">>, <<"ObjectLockLegalHoldStatus">>}, {<<"x-amz-version-id">>, <<"VersionId">>}, - {<<"Content-Type">>, <<"ContentType">>}, - {<<"x-amz-object-lock-mode">>, <<"ObjectLockMode">>}, - {<<"x-amz-server-side-encryption-customer-algorithm">>, <<"SSECustomerAlgorithm">>}, - {<<"x-amz-delete-marker">>, <<"DeleteMarker">>}, - {<<"x-amz-server-side-encryption-aws-kms-key-id">>, <<"SSEKMSKeyId">>}, - {<<"Cache-Control">>, <<"CacheControl">>}, - {<<"x-amz-mp-parts-count">>, <<"PartsCount">>}, - {<<"x-amz-request-charged">>, <<"RequestCharged">>}, + {<<"accept-ranges">>, <<"AcceptRanges">>}, {<<"x-amz-website-redirect-location">>, <<"WebsiteRedirectLocation">>}, - {<<"x-amz-checksum-sha1">>, <<"ChecksumSHA1">>}, + {<<"Content-Language">>, <<"ContentLanguage">>}, + {<<"x-amz-server-side-encryption-customer-algorithm">>, <<"SSECustomerAlgorithm">>}, + {<<"Content-Encoding">>, <<"ContentEncoding">>}, + {<<"x-amz-checksum-sha256">>, <<"ChecksumSHA256">>}, + {<<"ETag">>, <<"ETag">>}, {<<"x-amz-archive-status">>, <<"ArchiveStatus">>}, - {<<"x-amz-checksum-crc32c">>, <<"ChecksumCRC32C">>}, {<<"Last-Modified">>, <<"LastModified">>}, + {<<"Expires">>, <<"Expires">>}, + {<<"x-amz-expiration">>, <<"Expiration">>}, + {<<"x-amz-replication-status">>, <<"ReplicationStatus">>}, + {<<"Cache-Control">>, <<"CacheControl">>}, + {<<"x-amz-storage-class">>, <<"StorageClass">>}, {<<"x-amz-missing-meta">>, <<"MissingMeta">>}, + {<<"Content-Length">>, <<"ContentLength">>}, + {<<"x-amz-object-lock-mode">>, <<"ObjectLockMode">>}, + {<<"Content-Disposition">>, <<"ContentDisposition">>}, + {<<"x-amz-request-charged">>, <<"RequestCharged">>}, + {<<"x-amz-server-side-encryption">>, <<"ServerSideEncryption">>}, + {<<"x-amz-mp-parts-count">>, <<"PartsCount">>}, + {<<"x-amz-server-side-encryption-aws-kms-key-id">>, <<"SSEKMSKeyId">>}, {<<"x-amz-checksum-crc32">>, <<"ChecksumCRC32">>}, - {<<"x-amz-replication-status">>, <<"ReplicationStatus">>} + {<<"x-amz-checksum-sha1">>, <<"ChecksumSHA1">>} ], FoldFun = fun({Name_, Key_}, Acc_) -> case lists:keyfind(Name_, 1, ResponseHeaders) of @@ -6431,39 +6431,39 @@ put_object(Client, Bucket, Key, Input0, Options0) -> HeadersMapping = [ - {<<"Content-Language">>, <<"ContentLanguage">>}, - {<<"Expires">>, <<"Expires">>}, {<<"x-amz-sdk-checksum-algorithm">>, <<"ChecksumAlgorithm">>}, - {<<"x-amz-object-lock-legal-hold">>, <<"ObjectLockLegalHoldStatus">>}, - {<<"x-amz-server-side-encryption-bucket-key-enabled">>, <<"BucketKeyEnabled">>}, - {<<"x-amz-server-side-encryption-customer-key-MD5">>, <<"SSECustomerKeyMD5">>}, + {<<"x-amz-server-side-encryption-customer-key">>, <<"SSECustomerKey">>}, + {<<"x-amz-grant-full-control">>, <<"GrantFullControl">>}, + {<<"x-amz-acl">>, <<"ACL">>}, + {<<"x-amz-checksum-crc32c">>, <<"ChecksumCRC32C">>}, {<<"x-amz-object-lock-retain-until-date">>, <<"ObjectLockRetainUntilDate">>}, - {<<"Content-Length">>, <<"ContentLength">>}, {<<"x-amz-request-payer">>, <<"RequestPayer">>}, + {<<"x-amz-server-side-encryption-bucket-key-enabled">>, <<"BucketKeyEnabled">>}, + {<<"Content-Type">>, <<"ContentType">>}, + {<<"x-amz-server-side-encryption-customer-key-MD5">>, <<"SSECustomerKeyMD5">>}, + {<<"x-amz-object-lock-legal-hold">>, <<"ObjectLockLegalHoldStatus">>}, + {<<"x-amz-tagging">>, <<"Tagging">>}, {<<"x-amz-expected-bucket-owner">>, <<"ExpectedBucketOwner">>}, - {<<"Content-Disposition">>, <<"ContentDisposition">>}, + {<<"x-amz-website-redirect-location">>, <<"WebsiteRedirectLocation">>}, + {<<"Content-Language">>, <<"ContentLanguage">>}, + {<<"x-amz-server-side-encryption-customer-algorithm">>, <<"SSECustomerAlgorithm">>}, {<<"Content-Encoding">>, <<"ContentEncoding">>}, - {<<"x-amz-server-side-encryption">>, <<"ServerSideEncryption">>}, - {<<"x-amz-tagging">>, <<"Tagging">>}, {<<"x-amz-checksum-sha256">>, <<"ChecksumSHA256">>}, - {<<"x-amz-storage-class">>, <<"StorageClass">>}, - {<<"x-amz-acl">>, <<"ACL">>}, + {<<"Expires">>, <<"Expires">>}, {<<"Content-MD5">>, <<"ContentMD5">>}, - {<<"Content-Type">>, <<"ContentType">>}, - {<<"x-amz-object-lock-mode">>, <<"ObjectLockMode">>}, - {<<"x-amz-server-side-encryption-customer-algorithm">>, <<"SSECustomerAlgorithm">>}, {<<"x-amz-grant-write-acp">>, <<"GrantWriteACP">>}, - {<<"x-amz-grant-read-acp">>, <<"GrantReadACP">>}, - {<<"x-amz-grant-full-control">>, <<"GrantFullControl">>}, - {<<"x-amz-server-side-encryption-aws-kms-key-id">>, <<"SSEKMSKeyId">>}, + {<<"x-amz-server-side-encryption-context">>, <<"SSEKMSEncryptionContext">>}, {<<"Cache-Control">>, <<"CacheControl">>}, - {<<"x-amz-server-side-encryption-customer-key">>, <<"SSECustomerKey">>}, - {<<"x-amz-website-redirect-location">>, <<"WebsiteRedirectLocation">>}, - {<<"x-amz-checksum-sha1">>, <<"ChecksumSHA1">>}, - {<<"x-amz-checksum-crc32c">>, <<"ChecksumCRC32C">>}, + {<<"x-amz-storage-class">>, <<"StorageClass">>}, {<<"x-amz-grant-read">>, <<"GrantRead">>}, + {<<"Content-Length">>, <<"ContentLength">>}, + {<<"x-amz-object-lock-mode">>, <<"ObjectLockMode">>}, + {<<"Content-Disposition">>, <<"ContentDisposition">>}, + {<<"x-amz-server-side-encryption">>, <<"ServerSideEncryption">>}, + {<<"x-amz-server-side-encryption-aws-kms-key-id">>, <<"SSEKMSKeyId">>}, + {<<"x-amz-grant-read-acp">>, <<"GrantReadACP">>}, {<<"x-amz-checksum-crc32">>, <<"ChecksumCRC32">>}, - {<<"x-amz-server-side-encryption-context">>, <<"SSEKMSEncryptionContext">>} + {<<"x-amz-checksum-sha1">>, <<"ChecksumSHA1">>} ], {Headers, Input1} = aws_request:build_headers(HeadersMapping, Input0), @@ -7801,44 +7801,44 @@ write_get_object_response(Client, Input0, Options0) -> HeadersMapping = [ - {<<"x-amz-fwd-header-ETag">>, <<"ETag">>}, - {<<"x-amz-fwd-header-Content-Language">>, <<"ContentLanguage">>}, - {<<"x-amz-fwd-header-Expires">>, <<"Expires">>}, - {<<"x-amz-fwd-header-x-amz-object-lock-legal-hold">>, <<"ObjectLockLegalHoldStatus">>}, + {<<"x-amz-fwd-error-message">>, <<"ErrorMessage">>}, + {<<"x-amz-fwd-header-x-amz-checksum-crc32c">>, <<"ChecksumCRC32C">>}, + {<<"x-amz-fwd-header-x-amz-delete-marker">>, <<"DeleteMarker">>}, + {<<"x-amz-fwd-header-x-amz-object-lock-retain-until-date">>, <<"ObjectLockRetainUntilDate">>}, + {<<"x-amz-request-token">>, <<"RequestToken">>}, + {<<"x-amz-fwd-header-x-amz-restore">>, <<"Restore">>}, {<<"x-amz-request-route">>, <<"RequestRoute">>}, - {<<"x-amz-fwd-header-x-amz-expiration">>, <<"Expiration">>}, + {<<"x-amz-fwd-status">>, <<"StatusCode">>}, {<<"x-amz-fwd-header-x-amz-server-side-encryption-bucket-key-enabled">>, <<"BucketKeyEnabled">>}, - {<<"x-amz-fwd-header-x-amz-restore">>, <<"Restore">>}, + {<<"x-amz-fwd-header-Content-Type">>, <<"ContentType">>}, {<<"x-amz-fwd-header-x-amz-server-side-encryption-customer-key-MD5">>, <<"SSECustomerKeyMD5">>}, - {<<"x-amz-fwd-header-x-amz-object-lock-retain-until-date">>, <<"ObjectLockRetainUntilDate">>}, - {<<"Content-Length">>, <<"ContentLength">>}, - {<<"x-amz-fwd-header-Content-Disposition">>, <<"ContentDisposition">>}, - {<<"x-amz-fwd-header-Content-Encoding">>, <<"ContentEncoding">>}, - {<<"x-amz-fwd-header-x-amz-server-side-encryption">>, <<"ServerSideEncryption">>}, - {<<"x-amz-fwd-header-x-amz-checksum-sha256">>, <<"ChecksumSHA256">>}, - {<<"x-amz-fwd-header-accept-ranges">>, <<"AcceptRanges">>}, - {<<"x-amz-fwd-header-x-amz-storage-class">>, <<"StorageClass">>}, + {<<"x-amz-fwd-header-x-amz-object-lock-legal-hold">>, <<"ObjectLockLegalHoldStatus">>}, {<<"x-amz-fwd-header-x-amz-version-id">>, <<"VersionId">>}, - {<<"x-amz-fwd-header-Content-Type">>, <<"ContentType">>}, - {<<"x-amz-fwd-header-x-amz-object-lock-mode">>, <<"ObjectLockMode">>}, + {<<"x-amz-fwd-header-accept-ranges">>, <<"AcceptRanges">>}, + {<<"x-amz-fwd-header-Content-Language">>, <<"ContentLanguage">>}, {<<"x-amz-fwd-header-x-amz-server-side-encryption-customer-algorithm">>, <<"SSECustomerAlgorithm">>}, - {<<"x-amz-fwd-status">>, <<"StatusCode">>}, - {<<"x-amz-fwd-header-x-amz-delete-marker">>, <<"DeleteMarker">>}, + {<<"x-amz-fwd-header-Content-Encoding">>, <<"ContentEncoding">>}, + {<<"x-amz-fwd-header-x-amz-checksum-sha256">>, <<"ChecksumSHA256">>}, + {<<"x-amz-fwd-header-ETag">>, <<"ETag">>}, + {<<"x-amz-fwd-header-Last-Modified">>, <<"LastModified">>}, {<<"x-amz-fwd-error-code">>, <<"ErrorCode">>}, - {<<"x-amz-fwd-header-x-amz-server-side-encryption-aws-kms-key-id">>, <<"SSEKMSKeyId">>}, + {<<"x-amz-fwd-header-Content-Range">>, <<"ContentRange">>}, + {<<"x-amz-fwd-header-Expires">>, <<"Expires">>}, + {<<"x-amz-fwd-header-x-amz-tagging-count">>, <<"TagCount">>}, + {<<"x-amz-fwd-header-x-amz-expiration">>, <<"Expiration">>}, + {<<"x-amz-fwd-header-x-amz-replication-status">>, <<"ReplicationStatus">>}, {<<"x-amz-fwd-header-Cache-Control">>, <<"CacheControl">>}, - {<<"x-amz-fwd-header-x-amz-mp-parts-count">>, <<"PartsCount">>}, - {<<"x-amz-fwd-header-x-amz-request-charged">>, <<"RequestCharged">>}, - {<<"x-amz-fwd-header-x-amz-checksum-sha1">>, <<"ChecksumSHA1">>}, - {<<"x-amz-fwd-header-x-amz-checksum-crc32c">>, <<"ChecksumCRC32C">>}, - {<<"x-amz-fwd-header-Last-Modified">>, <<"LastModified">>}, + {<<"x-amz-fwd-header-x-amz-storage-class">>, <<"StorageClass">>}, {<<"x-amz-fwd-header-x-amz-missing-meta">>, <<"MissingMeta">>}, + {<<"Content-Length">>, <<"ContentLength">>}, + {<<"x-amz-fwd-header-x-amz-object-lock-mode">>, <<"ObjectLockMode">>}, + {<<"x-amz-fwd-header-Content-Disposition">>, <<"ContentDisposition">>}, + {<<"x-amz-fwd-header-x-amz-request-charged">>, <<"RequestCharged">>}, + {<<"x-amz-fwd-header-x-amz-server-side-encryption">>, <<"ServerSideEncryption">>}, + {<<"x-amz-fwd-header-x-amz-mp-parts-count">>, <<"PartsCount">>}, + {<<"x-amz-fwd-header-x-amz-server-side-encryption-aws-kms-key-id">>, <<"SSEKMSKeyId">>}, {<<"x-amz-fwd-header-x-amz-checksum-crc32">>, <<"ChecksumCRC32">>}, - {<<"x-amz-fwd-error-message">>, <<"ErrorMessage">>}, - {<<"x-amz-fwd-header-x-amz-replication-status">>, <<"ReplicationStatus">>}, - {<<"x-amz-request-token">>, <<"RequestToken">>}, - {<<"x-amz-fwd-header-x-amz-tagging-count">>, <<"TagCount">>}, - {<<"x-amz-fwd-header-Content-Range">>, <<"ContentRange">>} + {<<"x-amz-fwd-header-x-amz-checksum-sha1">>, <<"ChecksumSHA1">>} ], {Headers, Input1} = aws_request:build_headers(HeadersMapping, Input0), @@ -7917,7 +7917,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> aws_util:decode_xml(Body); + true -> + try + aws_util:decode_xml(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_s3_control.erl b/src/aws_s3_control.erl index ced7a63d..2b3acde3 100644 --- a/src/aws_s3_control.erl +++ b/src/aws_s3_control.erl @@ -3099,7 +3099,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> aws_util:decode_xml(Body); + true -> + try + aws_util:decode_xml(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_s3outposts.erl b/src/aws_s3outposts.erl index 6ef2a8a8..06ca7a34 100644 --- a/src/aws_s3outposts.erl +++ b/src/aws_s3outposts.erl @@ -224,7 +224,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_sagemaker_a2i_runtime.erl b/src/aws_sagemaker_a2i_runtime.erl index 5132b830..13b1305c 100644 --- a/src/aws_sagemaker_a2i_runtime.erl +++ b/src/aws_sagemaker_a2i_runtime.erl @@ -249,7 +249,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_sagemaker_edge.erl b/src/aws_sagemaker_edge.erl index 10afd854..cf16c895 100644 --- a/src/aws_sagemaker_edge.erl +++ b/src/aws_sagemaker_edge.erl @@ -149,7 +149,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_sagemaker_featurestore_runtime.erl b/src/aws_sagemaker_featurestore_runtime.erl index d49acc6e..af82e0f5 100644 --- a/src/aws_sagemaker_featurestore_runtime.erl +++ b/src/aws_sagemaker_featurestore_runtime.erl @@ -211,7 +211,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_sagemaker_geospatial.erl b/src/aws_sagemaker_geospatial.erl index a9e38f9a..e5aa8e17 100644 --- a/src/aws_sagemaker_geospatial.erl +++ b/src/aws_sagemaker_geospatial.erl @@ -580,7 +580,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_sagemaker_metrics.erl b/src/aws_sagemaker_metrics.erl index 1ee9fbbb..0e5f8988 100644 --- a/src/aws_sagemaker_metrics.erl +++ b/src/aws_sagemaker_metrics.erl @@ -108,7 +108,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_sagemaker_runtime.erl b/src/aws_sagemaker_runtime.erl index d31ec580..1223efb5 100644 --- a/src/aws_sagemaker_runtime.erl +++ b/src/aws_sagemaker_runtime.erl @@ -209,7 +209,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_savingsplans.erl b/src/aws_savingsplans.erl index decec058..ba5232c4 100644 --- a/src/aws_savingsplans.erl +++ b/src/aws_savingsplans.erl @@ -303,7 +303,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_scheduler.erl b/src/aws_scheduler.erl index 9f66d35a..de1dfb61 100644 --- a/src/aws_scheduler.erl +++ b/src/aws_scheduler.erl @@ -428,7 +428,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_schemas.erl b/src/aws_schemas.erl index f89fd37f..9d34aa48 100644 --- a/src/aws_schemas.erl +++ b/src/aws_schemas.erl @@ -920,7 +920,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_securityhub.erl b/src/aws_securityhub.erl index efb3645f..2cfe884e 100644 --- a/src/aws_securityhub.erl +++ b/src/aws_securityhub.erl @@ -1951,7 +1951,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_securitylake.erl b/src/aws_securitylake.erl index 962994de..57161177 100644 --- a/src/aws_securitylake.erl +++ b/src/aws_securitylake.erl @@ -1012,7 +1012,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_serverlessapplicationrepository.erl b/src/aws_serverlessapplicationrepository.erl index f24d6084..a8725637 100644 --- a/src/aws_serverlessapplicationrepository.erl +++ b/src/aws_serverlessapplicationrepository.erl @@ -502,7 +502,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_service_catalog_appregistry.erl b/src/aws_service_catalog_appregistry.erl index e2d6403e..b2c4aaf6 100644 --- a/src/aws_service_catalog_appregistry.erl +++ b/src/aws_service_catalog_appregistry.erl @@ -778,7 +778,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_sesv2.erl b/src/aws_sesv2.erl index 996ebb8e..502e7f1f 100644 --- a/src/aws_sesv2.erl +++ b/src/aws_sesv2.erl @@ -2715,7 +2715,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_signer.erl b/src/aws_signer.erl index 63c686c7..b27ee294 100644 --- a/src/aws_signer.erl +++ b/src/aws_signer.erl @@ -632,7 +632,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_simspaceweaver.erl b/src/aws_simspaceweaver.erl index c6e88982..1e163378 100644 --- a/src/aws_simspaceweaver.erl +++ b/src/aws_simspaceweaver.erl @@ -512,7 +512,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_snow_device_management.erl b/src/aws_snow_device_management.erl index d2e66663..2d676d82 100644 --- a/src/aws_snow_device_management.erl +++ b/src/aws_snow_device_management.erl @@ -446,7 +446,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_ssm_incidents.erl b/src/aws_ssm_incidents.erl index 339a975a..ec2befbf 100644 --- a/src/aws_ssm_incidents.erl +++ b/src/aws_ssm_incidents.erl @@ -867,7 +867,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_ssm_sap.erl b/src/aws_ssm_sap.erl index 7eef39b4..79bcb290 100644 --- a/src/aws_ssm_sap.erl +++ b/src/aws_ssm_sap.erl @@ -498,7 +498,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_sso.erl b/src/aws_sso.erl index 93c58455..c4644779 100644 --- a/src/aws_sso.erl +++ b/src/aws_sso.erl @@ -246,7 +246,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_sso_oidc.erl b/src/aws_sso_oidc.erl index 59b8f84d..4df18106 100644 --- a/src/aws_sso_oidc.erl +++ b/src/aws_sso_oidc.erl @@ -193,7 +193,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_support_app.erl b/src/aws_support_app.erl index 3e5f10c2..7e6a4098 100644 --- a/src/aws_support_app.erl +++ b/src/aws_support_app.erl @@ -431,7 +431,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_synthetics.erl b/src/aws_synthetics.erl index d2726961..26050bab 100644 --- a/src/aws_synthetics.erl +++ b/src/aws_synthetics.erl @@ -767,7 +767,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_transcribe_streaming.erl b/src/aws_transcribe_streaming.erl index 647cde8d..b7a769bd 100644 --- a/src/aws_transcribe_streaming.erl +++ b/src/aws_transcribe_streaming.erl @@ -344,7 +344,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_wellarchitected.erl b/src/aws_wellarchitected.erl index cd853377..103ad379 100644 --- a/src/aws_wellarchitected.erl +++ b/src/aws_wellarchitected.erl @@ -1359,7 +1359,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_wisdom.erl b/src/aws_wisdom.erl index 0d262842..d600b811 100644 --- a/src/aws_wisdom.erl +++ b/src/aws_wisdom.erl @@ -955,7 +955,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_workdocs.erl b/src/aws_workdocs.erl index 707d977a..30acd7c5 100644 --- a/src/aws_workdocs.erl +++ b/src/aws_workdocs.erl @@ -1522,7 +1522,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_worklink.erl b/src/aws_worklink.erl index 1d1ca27c..716dfc36 100644 --- a/src/aws_worklink.erl +++ b/src/aws_worklink.erl @@ -936,7 +936,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_workmailmessageflow.erl b/src/aws_workmailmessageflow.erl index ef4dda0d..a47122a8 100644 --- a/src/aws_workmailmessageflow.erl +++ b/src/aws_workmailmessageflow.erl @@ -136,7 +136,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_workspaces_web.erl b/src/aws_workspaces_web.erl index f37c5685..8660b9fb 100644 --- a/src/aws_workspaces_web.erl +++ b/src/aws_workspaces_web.erl @@ -1445,7 +1445,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}} diff --git a/src/aws_xray.erl b/src/aws_xray.erl index 1e2ba769..5d158d68 100644 --- a/src/aws_xray.erl +++ b/src/aws_xray.erl @@ -937,7 +937,13 @@ handle_response({ok, StatusCode, ResponseHeaders, Client}, SuccessStatusCode, De {ok, #{}, {StatusCode, ResponseHeaders, Client}}; {ok, Body} -> Result = case DecodeBody of - true -> jsx:decode(Body); + true -> + try + jsx:decode(Body) + catch + Error:Reason:Stack -> + erlang:raise(error, {body_decode_failed, Error, Reason, StatusCode, Body}, Stack) + end; false -> #{<<"Body">> => Body} end, {ok, Result, {StatusCode, ResponseHeaders, Client}}