Skip to content

Downgrade level of NotFound error for missing element in GET HTTP request #8061

Open
@eliuAtFanatics

Description

@eliuAtFanatics

Link to reproduction

No response

Describe the Bug

As discussed with @DanRibbens and @jmikrut, the error from a GET request for a missing element currently spits a message such as

ERROR (payload): NotFound: The requested resource was not found.
    at findByID (/Users/ben.routson/Repos/playmaker-cms/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/payload/src/collections/operations/findByID.ts:94:15)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at findByIDHandler (/Users/ben.routson/Repos/playmaker-cms/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/payload/src/collections/requestHandlers/findByID.ts:26:17)

James and I agreed that this should be downgraded to an info level message, as opposed to a system error, and can still be considered to return an HTTP 404 response. Thus, this ticket is requested to log the work to ensure that this type of GET message doesn't spit out a system error message/status.

To Reproduce

Just create a HTTP GET request for an element that doesn't exist in the DB/system, and observe the system/console for this error message.

Payload Version

2.24.1

Adapters and Plugins

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions