HF RL Explorer

Task: Handle Mongoose ObjectId Validation Errors

Task: Handle Mongoose ObjectId Validation Errors: a task in Terminal-Lego-15k (Harbor dataset). When building a Node.js API with Mongoose, attempting to find a document using findById() with an invalid ObjectId format (like "foo" instead of a valid 24-character hex string like…

The task

When building a Node.js API with Mongoose, attempting to find a document using `findById()` with an invalid ObjectId format (like "foo" instead of a valid 24-character hex string like "41224d776a326fb40f000001") throws a `CastError`:

Part of PrimeIntellect/Terminal-Lego-15k.