Skip to content

Check for error responses and handle them gracefully in resolveResources #3

@gravity-api

Description

@gravity-api

The resolveResources method in src/commands/show-workflow.ts does not robustly handle HTTP error responses. Current code may throw unhandled exceptions or provide poor user feedback when the server returns an error.

Relevant code section:

// TODO: Check for error responses and handle them gracefully
const listText = await (await fetch(`${baseUrl}/api/v4/g4/integration/files`)).text();
const resources: string[] = JSON.parse(listText);

Suggested action:

  • Implement proper error checking for HTTP responses in resolveResources.
  • Handle non-OK responses gracefully and provide user-friendly error messages.

File: src/commands/show-workflow.ts

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions