make error handling backwards compatible with api 0.6