fix(slurm): parse structured errors from non-2xx Slurm API responses
Replace ErrorResponse with SlurmAPIError that extracts structured errors/warnings from JSON body when Slurm returns non-2xx (e.g. 404 with valid JSON). Add IsNotFound helper for fallback logic. Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -137,11 +137,11 @@ func TestClient_ErrorHandling(t *testing.T) {
|
||||
t.Fatal("expected error for 500 response")
|
||||
}
|
||||
|
||||
errorResp, ok := err.(*ErrorResponse)
|
||||
errorResp, ok := err.(*SlurmAPIError)
|
||||
if !ok {
|
||||
t.Fatalf("expected *ErrorResponse, got %T", err)
|
||||
t.Fatalf("expected *SlurmAPIError, got %T", err)
|
||||
}
|
||||
if errorResp.Response.StatusCode != 500 {
|
||||
t.Errorf("expected status 500, got %d", errorResp.Response.StatusCode)
|
||||
if errorResp.StatusCode != 500 {
|
||||
t.Errorf("expected status 500, got %d", errorResp.StatusCode)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user