mirror of
https://github.com/pnpm/pnpm.git
synced 2026-03-23 17:41:50 -04:00
fix: cannot set property name of which has only a getter (#5574)
close #5572
This commit is contained in:
5
.changeset/wet-hornets-cheat.md
Normal file
5
.changeset/wet-hornets-cheat.md
Normal file
@@ -0,0 +1,5 @@
|
||||
---
|
||||
"pnpm": patch
|
||||
---
|
||||
|
||||
Don't fail if cannot override the name field of the error object [#5572](https://github.com/pnpm/pnpm/issues/5572).
|
||||
@@ -11,7 +11,11 @@ export function errorHandler (error: Error) {
|
||||
return
|
||||
}
|
||||
if (error.name != null && error.name !== 'pnpm' && !error.name.startsWith('pnpm:')) {
|
||||
error.name = 'pnpm'
|
||||
try {
|
||||
error.name = 'pnpm'
|
||||
} catch {
|
||||
// Sometimes the name property is read-only
|
||||
}
|
||||
}
|
||||
|
||||
// bole passes only the name, message and stack of an error
|
||||
|
||||
Reference in New Issue
Block a user