Wrote exception for Cannot define an accessor name on a read-only attribute
Wrote tests for Cannot define an accessor name on a read-only attribute
replaced throw_error with throw_exception