use attr_writer instead of error_mode= method

Use ````attr_writer :error_mode```` method to assign to error_mode instead of ````error_mode=```` method