Add function to translate errors to string.

This lets library users present friendly-ish error messages to their
(human) users.