Skip to content

GetReleaseAttachment API returns 500 when the ID is not found #20884

Closed
@earl-warren

Description

@earl-warren

Description

See here:

	attach, err := repo_model.GetAttachmentByID(ctx, attachID)
	if err != nil {
		ctx.Error(http.StatusInternalServerError, "GetAttachmentByID", err)
		return
	}

It should return 404 when attachID is not found instead.

Gitea Version

dev

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

a

Screenshots

a

Git Version

a

Operating System

a

How are you running Gitea?

a

Database

SQLite

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions