
On Thu, Nov 05, 2020 at 10:08:16AM +0800, Wu Fengguang wrote:
+ error_message = 'No matched commit url found' + send_error_email(error_message) + + raise error_message
That pattern is repeated in many places. How about uniformly catch error in higher level and call send_error_email()?
That is, only raise here and call send_error_email() uniformly in another place.
yes it can be optimize as this idea. I will do like this: def send_account my_commit_url, my_ssh_pubkey = parse_commit_url_pub_key acct_info = apply_my_account(my_ssh_pubkey) @my_info['my_commit_url'] = my_commit_url @my_info['my_login_name'] = acct_info['my_login_name'] store_account_info send_my_uuid rescue StandardError => e puts e.message puts e.backtrace send_error_email(e.message) end Thanks Luan Shengde
Thanks, Fengguang