Added codes to exceptions thrown by the SDK.

For issue #52