Reflect API error types in dxpy exception hierarchy
Fix getattr invocation portability issue