Files
floci/src
Hector Ventura 87749e4600 fix(emr): return AWS client-error codes instead of 500 InternalServerError (#1731)
* fix(emr): return AWS client-error codes instead of 500 InternalServerError

Three EMR paths returned 500 InternalServerError for pure client errors,
which SDK clients treat as retryable server faults. Verified against the
botocore model and moto: RunJobFlow with a missing Name now returns 400
ValidationException in the AWS validation-message format, AddJobFlowSteps
with an unknown cluster returns 400 InvalidRequestException with the
'Cluster id ... is not valid.' message already used by DescribeCluster,
and TerminateJobFlows now matches AWS semantics by terminating the
unprotected clusters in the request before failing with 400
ValidationException when any cluster is termination protected.

* fix(emr): reject only a missing Name and pin the validation message

Review follow-up: the blank-name branch produced a message claiming the value
was null, and rejecting an explicit empty string was itself stricter than AWS.
The Name member is REQUIRED with a len=[0..256] constraint, so real EMR accepts
an empty string and framework validation only rejects null. Restrict the check
to null, pin the validation message in the missing-Name test, and add a test
that an empty Name creates a cluster.
2026-07-05 09:48:34 -05:00
..