88 and returns None values for non-AWSError exceptions.
99 - ProvisioningResult carries AWS error fields through from the exception.
1010 - RequestStatusManagementService._handle_provisioning_failure writes
11- error_details["aws_error "] onto the Request aggregate.
12- - RequestDTO.from_domain exposes error_details["aws_error "] as the top-level
13- error field; to_dict includes the error block only when present.
11+ error_details["provider_error "] onto the Request aggregate.
12+ - RequestDTO.from_domain exposes error_details["provider_error "] (or legacy
13+ "aws_error") as the top-level error field; to_dict includes it only when present.
1414"""
1515
1616from __future__ import annotations
@@ -207,7 +207,7 @@ def test_partial_aws_error_attrs(self):
207207
208208
209209class TestHandleProvisioningFailure :
210- """error_details["aws_error "] is written when provisioning fails with AWS context."""
210+ """error_details["provider_error "] is written when provisioning fails with AWS context."""
211211
212212 def _make_service (self ):
213213 from orb .application .services .request_status_management_service import (
@@ -265,10 +265,10 @@ def test_no_aws_fields_leaves_error_details_clean(self):
265265 result = self ._make_provisioning_result (error_message = "generic error" )
266266 updated = svc ._handle_provisioning_failure (request , result )
267267 # aws_error key should be absent when no AWS details are available
268- assert "aws_error " not in updated .error_details
268+ assert "provider_error " not in updated .error_details
269269
270270 def test_aws_error_code_written_to_error_details (self ):
271- """UnauthorizedOperation is stored in error_details["aws_error "]["code"]."""
271+ """UnauthorizedOperation is stored in error_details["provider_error "]["code"]."""
272272 svc = self ._make_service ()
273273 request = self ._make_real_request ()
274274 result = self ._make_provisioning_result (
@@ -279,7 +279,7 @@ def test_aws_error_code_written_to_error_details(self):
279279 error_source = "aws.ec2.run_instances" ,
280280 )
281281 updated = svc ._handle_provisioning_failure (request , result )
282- aws_err = updated .error_details .get ("aws_error " , {})
282+ aws_err = updated .error_details .get ("provider_error " , {})
283283 assert aws_err ["code" ] == "UnauthorizedOperation"
284284 assert aws_err ["message" ] == "You are not authorized."
285285 assert aws_err ["aws_request_id" ] == "rid-aws-001"
@@ -295,7 +295,7 @@ def test_partial_aws_fields_stored(self):
295295 # aws_error_message, aws_request_id, error_source intentionally absent
296296 )
297297 updated = svc ._handle_provisioning_failure (request , result )
298- aws_err = updated .error_details .get ("aws_error " , {})
298+ aws_err = updated .error_details .get ("provider_error " , {})
299299 assert aws_err ["code" ] == "InsufficientInstanceCapacity"
300300 assert "message" not in aws_err
301301 assert "aws_request_id" not in aws_err
0 commit comments