Skip to content

Commit 833ddbf

Browse files
committed
fix: slightly improve github & invenio error messages
Some messages had some redundancy in them and others didn't provide enough context.
1 parent 018ade9 commit 833ddbf

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

iga/cli.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -173,11 +173,11 @@ def _read_server(ctx, param, value):
173173
' does not appear to be a valid host or IP address.')
174174
sys.exit(int(ExitCode.bad_arg))
175175
if not invenio_api_available(server):
176-
_alert(ctx, f'The server address ({server}) does not appear to be'
177-
' reacheable or does not support the InvenioRDM API.')
176+
_alert(ctx, f'The InvenioRDM server address ({server}) does not appear'
177+
' to be reacheable or does not support the InvenioRDM API.')
178178
sys.exit(int(ExitCode.bad_arg))
179179
if not invenio_token_valid(server):
180-
_alert(ctx, f'The personal access token was rejected by {server}.')
180+
_alert(ctx, f'The InvenioRDM personal access token was rejected by {server}.')
181181
sys.exit(int(ExitCode.bad_token))
182182
if name := invenio_server_name(server):
183183
os.environ['INVENIO_SERVER_NAME'] = name
@@ -735,10 +735,10 @@ def cli(ctx, url_or_tag, all_assets=False, community=None, draft=False,
735735
pass
736736
except Exception as ex: # noqa: PIE786
737737
if isinstance(ex, GitHubError):
738-
_alert(ctx, f'Experienced an error interacting with GitHub: {ex}')
738+
_alert(ctx, str(ex))
739739
exit_code = ExitCode.github_error
740740
elif isinstance(ex, InvenioRDMError):
741-
text = 'Experienced an error interacting with InvenioRDM.'
741+
text = 'Failed while interacting with InvenioRDM.'
742742
if record:
743743
text += (' The partially-completed record can be found at'
744744
f' [{record.draft_url}]({record.draft_url}). You'

0 commit comments

Comments
 (0)