fix(tools): pass errorExtractor to executor and handle all Atlassian error formats#4088
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview Removes the hardcoded "JSM Forms API error:" prefix and falls back to returning raw Reviewed by Cursor Bugbot for commit da76758. Configure here. |
Greptile SummaryThis PR updates Confidence Score: 4/5Safe to merge for Forms tools; jsm_create_request and jsm_get_request error surfacing remains incomplete. The shared parseJsmErrorMessage in utils.ts is correctly updated and the three Forms proxy routes will benefit. However, request/route.ts still contains a local copy that only handles errorMessage, so jsm_create_request and jsm_get_request operations won't surface Atlassian error details for the four other error formats. This is a present defect in the changed surface area. apps/sim/app/api/tools/jsm/request/route.ts — local parseJsmErrorMessage at lines 15–27 should be replaced with an import from @/tools/jsm/utils Important Files Changed
Sequence DiagramsequenceDiagram
participant Executor
participant ProxyRoute as JSM Proxy Route
participant Atlassian as Atlassian API
participant Utils as jsm/utils.ts (updated)
Executor->>ProxyRoute: POST /api/tools/jsm/...
ProxyRoute->>Atlassian: API call
Atlassian-->>ProxyRoute: 4xx error body
alt Forms routes (forms/issue, forms/structure, forms/templates)
ProxyRoute->>Utils: parseJsmErrorMessage(status, statusText, errorText)
Note over Utils: Handles all 5 formats:<br/>errorMessage, errorMessages[],<br/>errors[].title, errors{}, message
Utils-->>ProxyRoute: Formatted error string
ProxyRoute-->>Executor: { error: "Atlassian error detail" }
else request/route.ts (jsm_create_request, jsm_get_request)
Note over ProxyRoute: Local parseJsmErrorMessage<br/>only handles errorData.errorMessage
ProxyRoute-->>Executor: { error: "JSM API error: 400 Bad Request" } stale fallback
end
|
Update parseJsmErrorMessage to extract errors from all Atlassian API response formats: errorMessage (JSM), errorMessages array (Jira), errors[].title RFC 7807 (Confluence/Forms), field-level errors object, and message (gateway). Remove redundant prefix wrapping so the raw error message surfaces cleanly through the extractor.
c98e80a to
da76758
Compare
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit da76758. Configure here.
#4088) Update parseJsmErrorMessage to extract errors from all Atlassian API response formats: errorMessage (JSM), errorMessages array (Jira), errors[].title RFC 7807 (Confluence/Forms), field-level errors object, and message (gateway). Remove redundant prefix wrapping so the raw error message surfaces cleanly through the extractor.
Summary
tool.errorExtractortoextractErrorMessagein the executor — previously the tool-specific extractor ID was never used, so all tools fell back to the generic extraction loopparseJsmErrorMessageto handle all Atlassian error formats (errorMessage, errorMessages[], errors[].title RFC 7807, message) instead of only JSM's singular errorMessagedata.errorstring fallback to theatlassian-errorsextractor so errors from our API routes are properly surfacedTest plan