ES /docs

iSpring account creation failed: 400 Bad Request

Validation: ee8d60f2-368d-40c8-841e-de04b2c78328

Verdict: APPROVED#

Completeness#

Plan Item Status Evidence
Split create_user rescue into RestClient::Exception and StandardError PASS app/operations/ispring_operation.rb: lines 36-43 add rescue RestClient::Exception => e block with error_body, logger, and re-raise; lines 44-50 preserve original rescue StandardError => e block

Acceptance Criteria#

Criterion Status Evidence
rescue RestClient::Exception => e block exists before rescue StandardError => e PASS app/operations/ispring_operation.rb: line 36 rescue RestClient::Exception => e precedes line 44 rescue StandardError => e
error_body variable stores e.response&.body and is passed to Cupix::Logger.error as response: keyword PASS app/operations/ispring_operation.rb: line 37 error_body = e.response&.body || ''; line 38 Cupix::Logger.error(... response: error_body, request_body: request_body)
Existing rescue StandardError => e block remains as separate fallback PASS app/operations/ispring_operation.rb: lines 44-50 retain original rescue StandardError => e block unchanged with its own logger call (without response:) and raise
Structure matches update_user_role (lines 78-85) and create_department (lines 118-125) two-stage rescue pattern PASS app/operations/ispring_operation.rb: new lines 36-43 follow identical structure -- rescue RestClient::Exception => e / error_body = e.response&.body || '' / Cupix::Logger.error with response: and request_body: keywords / raise Cupix::Errors::BadGateway.new(code: 'BG10001', ...) -- matching both update_user_role (lines 78-85) and create_department (lines 118-125)

Issues Found#

No blocking issues found.

Observations#

  • The change is minimal and surgical: only 8 lines added, no existing lines modified or removed.
  • The request_body is included in the logger call for the RestClient::Exception branch (matching the pattern in update_user_role and create_department), but not in the StandardError branch. This is consistent with the existing codebase pattern -- only HTTP errors get the request body logged.
  • The error code BG10001 is reused across all iSpring operations, which is the existing convention in this file.