From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on gnuweeb.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,NO_DNS_FOR_FROM, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from [192.168.1.2] (unknown [101.128.126.183]) by gnuweeb.org (Postfix) with ESMTPSA id E5F41804D1; Fri, 28 Oct 2022 19:38:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gnuweeb.org; s=default; t=1666985918; bh=67cvYEoiEDrXKbCSEpzdXPZa00lUusR92fT4W1SEThQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=WIQlV2N6HGs/hsT63bLNW60WykzMK4ahoOCgU9TkIRGkZzGHafWQVOLfaf2Hc2fPw UvstrPjCZ7Zi14PjIVZrd/vpqvfAppOTjPHpmcxEG8bN3konD8DxsYToby2/ZS12x3 TL6pDPkUX2OCPL2aShYz6FRDBdYWBU3kKTdbO9UAdO9giHUwFAsqqIrz5YD5qfIyR7 LxN1beJZjDdSbGJQA7XFsujJ31fvkRGLC/zKAcg8xPxo11EXYETyoaDqJhIbPys0Pk sFGJwR8zhyEnY34As8av67cbEsxRsDKEfT5idCeveVOr5GiPGCa+gqcmj0l9eRlc7S ZpEYPVZybAwQA== Message-ID: <7ff8b051-e6e2-dece-6e56-3fbcf6595215@gnuweeb.org> Date: Sat, 29 Oct 2022 02:38:34 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Subject: Re: [PATCH v1 2/2] daemon: telegram: Handle MySQL error Content-Language: en-US To: Ammar Faizi , Alviro Iskandar Setiawan Cc: GNU/Weeb Mailing List References: <20221027150823.601914-1-ammarfaizi2@gnuweeb.org> <20221027150823.601914-3-ammarfaizi2@gnuweeb.org> <1d500d37-b11b-75fd-38e5-d7f8e0a9b1d4@gnuweeb.org> <3a79a587-ddee-9e25-2ac5-b573938b44a9@gnuweeb.org> <043f55c3-67d8-9130-aca4-73c59926d2af@gnuweeb.org> <63aa1b63-f7e2-8da3-b16d-0c7e1045d697@gnuweeb.org> <9ecfe8ab-fa5a-d01a-0b68-bc639f14888f@gnuweeb.org> <59d21a5e-8ade-f9fe-b2e5-1bea79b07921@gnuweeb.org> <71de4c1b-7482-5f7f-4c4f-4dbff7ee32ad@gnuweeb.org> <086b02fa-05ba-f546-311a-8f1a06b3dece@gnuweeb.org> From: Muhammad Rizki In-Reply-To: <086b02fa-05ba-f546-311a-8f1a06b3dece@gnuweeb.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: On 29/10/22 02.33, Ammar Faizi wrote: > On 10/29/22 2:22 AM, Muhammad Rizki wrote: >> I create that statement because: > [...] >>          try: >>              text, files, is_patch = utils.create_template(mail, >> Platform.TELEGRAM) >>          except: >> >>              # ensure the created tmp dir is removed >>              utils.remove_patch() >> >>              exc_str = utils.catch_err() >>              self.client.logger.warning(exc_str) >>              await self.client.send_log_file(url) >> >>              # return, to avoid local variable error >>              return > > This is ugly, will you do the: > >     exc_str = utils.catch_err() >     self.client.logger.warning(exc_str) >     await self.client.send_log_file(url) > > all over the place when error may happen? > IDK, this is still debugging method. I don't have any idea when "all over the place when error may happen".