This is an automated email from the ASF dual-hosted git repository.

xuang7 pushed a commit to branch release/v1.2
in repository https://gitbox.apache.org/repos/asf/texera.git


The following commit(s) were added to refs/heads/release/v1.2 by this push:
     new af40467190 fix(computing-unit, v1.2): return 404 instead of 500 when 
getOwner is called for a nonexistent unit  (#7002)
af40467190 is described below

commit af40467190ed06ab62b883f52d1db95b60d64da3
Author: Yicong Huang <[email protected]>
AuthorDate: Wed Jul 29 14:04:56 2026 -0400

    fix(computing-unit, v1.2): return 404 instead of 500 when getOwner is 
called for a nonexistent unit  (#7002)
    
    ### What changes were proposed in this PR?
    
    Backport of #6612 to `release/v1.2`, cherry-picked from
    3a671c31ffe7f5a48da5b2e98841b0d55e176acc.
    
    **Source fix only.** The test changes from #6612 were omitted: the
    touched test spec(s) do not exist on `release/v1.2` (or depend on
    main-only test infrastructure), so backporting them cleanly is not
    possible. Only the source fix is carried over, per maintainer guidance.
    
    ### Any related issues, documentation, discussions?
    
    Backport of #6612. Originally linked #6475.
    
    ### How was this PR tested?
    
    Release-branch CI runs on this PR. The source change cherry-picked
    cleanly; test changes were intentionally dropped (see above).
    
    ### Was this PR authored or co-authored using generative AI tooling?
    
    Yes — backport prepared with Claude Code (mechanical cherry-pick +
    conflict resolution; the change itself is #6612 by its original author).
    
    🤖 Generated with [Claude Code](https://claude.com/claude-code)
    
    Co-authored-by: Prateek Ganigi <[email protected]>
---
 .../apache/texera/service/resource/ComputingUnitAccessResource.scala | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 
a/computing-unit-managing-service/src/main/scala/org/apache/texera/service/resource/ComputingUnitAccessResource.scala
 
b/computing-unit-managing-service/src/main/scala/org/apache/texera/service/resource/ComputingUnitAccessResource.scala
index 9538ca4168..c02d3aa7cf 100644
--- 
a/computing-unit-managing-service/src/main/scala/org/apache/texera/service/resource/ComputingUnitAccessResource.scala
+++ 
b/computing-unit-managing-service/src/main/scala/org/apache/texera/service/resource/ComputingUnitAccessResource.scala
@@ -205,7 +205,10 @@ class ComputingUnitAccessResource {
       val workflowComputingUnitDao = new 
WorkflowComputingUnitDao(ctx.configuration())
       val unit = workflowComputingUnitDao.fetchOneByCuid(cuid)
       if (unit == null) {
-        throw new IllegalArgumentException("Computing unit does not exist")
+        // JAX-RS exception so it maps to 404: the service registers no 
ExceptionMapper
+        // for IllegalArgumentException, which would otherwise surface as an 
HTTP 500.
+        // Message style matches ComputingUnitManagingResource's 
nonexistent-unit error.
+        throw new NotFoundException(s"Computing unit with cuid=$cuid does not 
exist.")
       }
 
       val uid = unit.getUid

Reply via email to