Added a more descriptive error message for encodeInt/Float/Double

I usually print out the error as a string, and previously it output null. I'd much rather have it output something that is more representative of what actually went wrong.