Skip to content

Commit

Permalink
refactor(ses): Improve permit exception messages
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal committed Sep 20, 2024
1 parent 4a8196b commit 8f6291d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/ses/src/permits-intrinsics.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,10 @@ export default function whitelistIntrinsics(
return;
}

// We can't clean [[prototype]], therefore abort.
throw TypeError(`Unexpected intrinsic ${path}.__proto__ at ${protoName}`);
// We can't clean [[Prototype]], therefore abort.
throw TypeError(
`Unexpected [[Prototype]] at ${path}.__proto__ (expected ${protoName || '%ObjectPrototype%'})`,
);
}

/*
Expand Down Expand Up @@ -212,7 +214,9 @@ export default function whitelistIntrinsics(
}
}

throw TypeError(`Unexpected whitelist permit ${permit} at ${path}`);
throw TypeError(
`Unexpected property ${prop} with permit ${permit} at ${path}`,
);
}

/*
Expand Down

0 comments on commit 8f6291d

Please sign in to comment.