question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error P2025 missing from docs

See original GitHub issue

Problem

The docs are missing the Record to update not found. error code P2025.

https://www.prisma.io/docs/reference/api-reference/error-reference#prismaclientknownrequesterror

Suggested solution

Add the P2025 code to the docs

Alternatives

Remove the error from Prisma? No I’m sorry, I don’t have a good alternative.

Additional context

😃

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
mhwelandercommented, Mar 2, 2021

Added - thanks for raising!

0reactions
BenjaminGuzmancommented, Apr 17, 2021

Yes, the same error code P2025 is thrown no matter if it is an update or delete, however the message is different.

try {
    prisma.entity.delete({
	    where: {
		    id: incorrectId
    	    }
    });
} catch(e) {
    console.log(e.code); // P2025
    console.log(e.message); // An operation failed because it depends on one or more records that were required but not found. Record to delete does not exist.
}

and


try {
    prisma.entity.update({
	    where: {
		    id: incorrectId
    	    },
           data: newData
    });
} catch(e) {
    console.log(e.code); // P2025
    // however
    console.log(e.message); // An operation failed because it depends on one or more records that were required but not found. Record to update not found.
}

But the docs say P2025 is thrown when the Record to delete does not exist.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error message reference - Prisma
Prisma Client throws a PrismaClientValidationError exception if validation fails - for example: Missing field - for example, an empty data: {} property when ......
Read more >
Troubleshoot Google Docs, Sheets, Slides & Forms error ...
If you get an error message such as "Something went wrong. Reload" or "Unable to load file" preventing you from making edits on...
Read more >
Prisma failed queries don't return proper errors - Stack Overflow
This is where I execute the query that I expected to get the proper error as per the docs: user.controller.ts : import {...
Read more >
Compliance visit Provider Follow-up plan- Paper_Non Compliant
P2025 Zoster Vaccine: CDC Answers Your Questions ... P3036 Don't be Guilty of These Preventable Errors in ... and lost/wasted in the previous...
Read more >
"Disappearing" docs - Google Groups
The only time I ever lost documents is when I misunderstood the way they were stored on my Linux ... I can't tell...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found