Fix #26 pass full error object when creating errors

This problem was caused due to a change in error structure introduced in API version 1.3.

This library is not currently kept up to date.