BUG: fix broken error message in ujson.encode() (GH18878)
- [x] closes #18878
- [x] tests added / passed
- [ ] passes `black pandas`
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

thanks @rlamy 