bug: getting contents of non existing path produces misleading error #459

Closed
opened 2020-11-20 16:03:14 +00:00 by mavogel · 1 comment

Current behaviour

When calling

func (c *Client) GetContents(owner, repo, ref, filepath string) (*ContentsResponse, *Response, error) {

on a non-existing filepath the following error is produced
json: cannot unmarshal array into Go value of type gitea.ContentsResponse

Desired behaviour

The error message should be more describing, like file path '/path/to/' does not exist

References

<!-- 1. Please speak English, this is the language all of us can speak and write. 2. Please ask questions or configuration/deploy problems on our Discord server (https://discord.gg/NsatcWJ) or forum (https://discourse.gitea.io). 3. Please take a moment to check that your issue doesn't already exist. 4. Please give all relevant information below for bug reports, because incomplete details will be handled as an invalid report. --> ### Current behaviour When calling ```go func (c *Client) GetContents(owner, repo, ref, filepath string) (*ContentsResponse, *Response, error) { ``` on a non-existing filepath the following error is produced `json: cannot unmarshal array into Go value of type gitea.ContentsResponse` ### Desired behaviour The error message should be more describing, like `file path '/path/to/' does not exist` ### References - https://github.com/goreleaser/goreleaser/pull/1547#issuecomment-730031118
6543 added this to the v0.14.0 milestone 2020-11-20 18:32:07 +00:00
6543 added the
kind/bug
label 2020-11-20 18:32:17 +00:00
Owner

related to #485 ... adding tests should clarify it ...

related to #485 ... adding tests should clarify it ...
6543 self-assigned this 2021-02-13 05:48:40 +00:00
6543 added the
has/pull
label 2021-02-16 20:52:42 +00:00
6543 closed this issue 2021-02-16 22:47:22 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: gitea/go-sdk#459
No description provided.