Skip to content

Conversation

@shihanpan
Copy link
Collaborator

- Clarify that 401 errors can be due to invalid/expired API token OR insufficient permissions
- Add direct link to Workato API client management documentation
- Restructure error message to show both possible causes and resolution steps
- Improve actionability of error message for users debugging auth issues

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>

@shihanpan shihanpan requested review from cmworkato and hovu96 January 7, 2026 01:30
@github-actions
Copy link

github-actions bot commented Jan 7, 2026

Coverage

Coverage Report
FileStmtsMissCoverMissing
__init__.py68494%10–11, 69–70
cli
   __init__.py52394%49, 51, 60
   containers.py270100% 
cli/commands
   __init__.py00100% 
   api_clients.py291996%27, 302, 448–449, 483, 493, 584, 615, 623
   api_collections.py257398%28, 183, 347
   assets.py47295%57–58
   connections.py526599%591, 593, 599, 637, 988
   data_tables.py165596%31, 253, 267, 321–322
   guide.py166199%106
   init.py1070100% 
   profiles.py2310100% 
   properties.py97198%21
   pull.py172298%193–194
   workspace.py39294%61, 71
cli/commands/connectors
   __init__.py00100% 
   command.py90297%110, 159
   connector_manager.py203498%176, 292, 300–301
cli/commands/projects
   __init__.py00100% 
   command.py2721096%359–362, 373, 439–441, 491, 495
   project_manager.py166795%48, 66, 263–264, 276, 317, 325
cli/commands/push
   __init__.py00100% 
   command.py133496%109, 112, 230, 308
cli/commands/recipes
   __init__.py00100% 
   command.py427997%117, 133–134, 272–275, 403, 709
   validator.py7062097%174, 883, 1136, 1223, 1246, 1279, 1281–1282, 1359–1361, 1457–1458, 1517–1518, 1707–1708, 1736–1738
cli/utils
   __init__.py40100% 
   exception_handler.py3453390%134–135, 140–141, 143–144, 174–175, 181, 184–185, 270, 300, 333–337, 371, 398, 425, 482, 517, 576, 578–579, 584–585, 587–591
   gitignore.py140100% 
   ignore_patterns.py230100% 
   spinner.py430100% 
   token_input.py451762%70, 98, 100, 102–104, 107, 124, 127–128, 132–133, 136, 139–140, 142, 144
   version_checker.py135695%24, 26, 33–34, 72, 102
cli/utils/config
   __init__.py50100% 
   manager.py5313393%127, 138, 149, 157–159, 162, 165, 177, 227–228, 399, 417, 421, 424–427, 443, 464, 478, 491, 533, 623–624, 661, 875, 1018–1019, 1033–1034, 1090, 1149
   models.py330100% 
   profiles.py3341595%99, 195–196, 199, 234–236, 261–263, 522, 530, 541–542, 546
   workspace.py680100% 
TOTAL582219796% 

@shihanpan shihanpan force-pushed the DEVP-660-modify-api-client-error-messages branch 4 times, most recently from d4c6270 to c271bd7 Compare January 7, 2026 02:11
Copy link
Collaborator

@cmworkato cmworkato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When an authentication error occurs during any CLI command execution, the error should provide a hint to the user which references the specific Workato API Client scope(s) which are missing.

The error should call out the specific missing permission(s) in the API Client so the user understands exactly which permission is missing and can efficiently remedy the issue in the Workato UI.

    - Clarify that 401 errors can be due to invalid/expired API token OR insufficient permissions
    - Add direct link to Workato API client management documentation
    - Restructure error message to show both possible causes and resolution steps
    - Improve actionability of error message for users debugging auth issues

    🤖 Generated with [Claude Code](https://claude.com/claude-code)

    Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@shihanpan shihanpan force-pushed the DEVP-660-modify-api-client-error-messages branch 3 times, most recently from ff78979 to 95928d7 Compare January 16, 2026 02:59
@shihanpan shihanpan force-pushed the DEVP-660-modify-api-client-error-messages branch from 95928d7 to d02946a Compare January 16, 2026 14:08
@shihanpan
Copy link
Collaborator Author

Tested; permissions required shown as part of the error message
Screenshot 2026-01-16 at 10 56 18 AM
Screenshot 2026-01-16 at 10 56 36 AM

@shihanpan
Copy link
Collaborator Author

@shihanpan shihanpan requested a review from cmworkato January 21, 2026 15:13
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shihanpan The CLI reported an "Authentication Error" and eludes to the cause being an Invalid API Token, regardless of whether or not this is actually the case.

In cases where this is an "Authorization Error" due to API scopes, we should report that only.

The end state is that only a single error condition can occur and be reported (i.e. either your API Token is bad, or your API scopes are bad, not both).

@shihanpan
Copy link
Collaborator Author

Capturing offline discussion. Since the current API returns 401 for both authorization error (not enough permissions) and authentication errors (wrong/bad API keys), there isn't really a way to distinguish this in our error response. Would need to reach out to P&E for clarification and potential feature request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants