Add 3d error type and test code for that.

Add 3d error type and test code for that.