Skip to content

Commit 8465899

Browse files
committed
v2.2.1 - [CHANGES] Include error message
1 parent 9d5f84e commit 8465899

File tree

3 files changed

+27
-23
lines changed

3 files changed

+27
-23
lines changed

bot/telegram_bot.py

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def start(update, context):
5858
return CS.SET_UP
5959
except Exception as e:
6060
print(e)
61-
update.message.reply_text(ERROR_TEXT)
61+
update.message.reply_text(ERROR_TEXT + "\nError:\n" + str(e))
6262
return ConversationHandler.END
6363

6464

@@ -179,7 +179,7 @@ def config_handler(update, context) -> int:
179179
)
180180
return CS.CONFIG_SETUP
181181
except Exception as e:
182-
update.callback_query.message.reply_text(ERROR_TEXT)
182+
update.callback_query.message.reply_text(ERROR_TEXT + "\nError:\n" + str(e))
183183
return ConversationHandler.END
184184

185185

@@ -199,7 +199,7 @@ def config_setup(update, context) -> int:
199199
return CS.CONFIG_CATEGORY
200200
except Exception as e:
201201
print(e)
202-
update.callback_query.message.reply_text(ERROR_TEXT)
202+
update.callback_query.message.reply_text(ERROR_TEXT + "\nError:\n" + str(e))
203203
return ConversationHandler.END
204204
update.callback_query.edit_message_text(END_TEXT, reply_markup=None)
205205
return ConversationHandler.END
@@ -234,7 +234,7 @@ def config_category(update, context) -> int:
234234
return CS.CONFIG_SUBCATEGORY
235235
except Exception as e:
236236
print(e)
237-
update.callback_query.reply_text(ERROR_TEXT)
237+
update.callback_query.reply_text(ERROR_TEXT + "\nError:\n" + str(e))
238238
return ConversationHandler.END
239239

240240

@@ -257,7 +257,7 @@ def config_subcategory(update, context) -> int:
257257
return CS.CONFIG_PAYMENT
258258
except Exception as e:
259259
print(e)
260-
update.callback_query.message.reply_text(ERROR_TEXT)
260+
update.callback_query.message.reply_text(ERROR_TEXT + "\nError:\n" + str(e))
261261
return ConversationHandler.END
262262

263263

@@ -277,7 +277,7 @@ def config_payment(update, context) -> int:
277277
return CS.CONFIG_SUBPAYMENT
278278
except Exception as e:
279279
print(e)
280-
update.callback_query.message.reply_text(ERROR_TEXT)
280+
update.callback_query.message.reply_text(ERROR_TEXT + "\nError:\n" + str(e))
281281
return ConversationHandler.END
282282

283283

@@ -303,7 +303,7 @@ def config_subpayment(update, context) -> int:
303303
return ConversationHandler.END
304304
except Exception as e:
305305
print(e)
306-
update.callback_query.message.reply_text(ERROR_TEXT)
306+
update.callback_query.message.reply_text(ERROR_TEXT + "\nError:\n" + str(e))
307307
return ConversationHandler.END
308308

309309

@@ -363,7 +363,7 @@ def remarks(update: Update, context) -> int:
363363
return CS.CATEGORY
364364
except Exception as e:
365365
print(e)
366-
update.message.reply_text(ERROR_TEXT)
366+
update.message.reply_text(ERROR_TEXT + "\nError:\n" + str(e))
367367
return ConversationHandler.END
368368

369369

@@ -408,7 +408,7 @@ def category(update, context) -> int:
408408
return CS.PAYMENT
409409
except Exception as e:
410410
print(e)
411-
update.callback_query.reply_text(ERROR_TEXT)
411+
update.callback_query.reply_text(ERROR_TEXT + "\nError:\n" + str(e))
412412
return ConversationHandler.END
413413

414414

@@ -435,7 +435,7 @@ def subcategory(update, context) -> int:
435435
return CS.PAYMENT
436436
except Exception as e:
437437
print(e)
438-
update.callback_query.message.reply_text(ERROR_TEXT)
438+
update.callback_query.message.reply_text(ERROR_TEXT + "\nError:\n" + str(e))
439439
return ConversationHandler.END
440440

441441

@@ -467,7 +467,7 @@ def payment(update, context) -> int:
467467
return ConversationHandler.END
468468
except Exception as e:
469469
print(e)
470-
update.callback_query.message.reply_text(ERROR_TEXT)
470+
update.callback_query.message.reply_text(ERROR_TEXT + "\nError:\n" + str(e))
471471
return ConversationHandler.END
472472

473473

@@ -495,7 +495,7 @@ def subpayment(update, context) -> int:
495495

496496
except Exception as e:
497497
print(e)
498-
update.callback_query.message.reply_text(ERROR_TEXT)
498+
update.callback_query.message.reply_text(ERROR_TEXT + "\nError:\n" + str(e))
499499
return ConversationHandler.END
500500

501501

@@ -608,7 +608,7 @@ def add_transport(update, context):
608608
)
609609
except Exception as e:
610610
print(e)
611-
update.callback_query.message.reply_text(ERROR_TEXT)
611+
update.callback_query.message.reply_text(ERROR_TEXT + "\nError:\n" + str(e))
612612
return ConversationHandler.END
613613
if not setting_list or not setting_list[0]:
614614
update.message.reply_text(QUICK_SETUP_TRANSPORT)
@@ -645,7 +645,7 @@ def add_others(update, context):
645645
)
646646
except Exception as e:
647647
print(e)
648-
update.callback_query.message.reply_text(ERROR_TEXT)
648+
update.callback_query.message.reply_text(ERROR_TEXT + "\nError:\n" + str(e))
649649
return ConversationHandler.END
650650
if not setting_list or not setting_list[0]:
651651
update.message.reply_text(QUICK_SETUP_OTHER)
@@ -693,7 +693,7 @@ def quick_add(update, context) -> int:
693693
update.message.reply_text("Transaction logged.")
694694
return ConversationHandler.END
695695
except Exception as e:
696-
update.message.reply_text(ERROR_TEXT)
696+
update.message.reply_text(ERROR_TEXT + "\nError:\n" + str(e))
697697
return ConversationHandler.END
698698
except Exception as e:
699699
print(e)
@@ -714,7 +714,7 @@ def get_day_transaction(update, context):
714714
return CS.HANDLE_GET_TRANSACTION
715715
except Exception as e:
716716
print(e)
717-
update.message.reply_text(ERROR_TEXT)
717+
update.message.reply_text(ERROR_TEXT + "\nError:\n" + str(e))
718718
return ConversationHandler.END
719719

720720

@@ -727,7 +727,7 @@ def get_overall(update, context):
727727
return CS.HANDLE_GET_OVERALL
728728
except Exception as e:
729729
print(e)
730-
update.message.reply_text(ERROR_TEXT)
730+
update.message.reply_text(ERROR_TEXT + "\nError:\n" + str(e))
731731
return ConversationHandler.END
732732

733733

@@ -770,7 +770,7 @@ def handle_get_transaction(update, context):
770770
return CS.HANDLE_GET_TRANSACTION
771771
except Exception as e:
772772
print(e)
773-
update.message.reply_text(ERROR_TEXT)
773+
update.message.reply_text(ERROR_TEXT + "\nError:\n" + str(e))
774774
return ConversationHandler.END
775775

776776

@@ -807,7 +807,7 @@ def handle_get_overall(update, context):
807807
return CS.HANDLE_GET_OVERALL
808808
except Exception as e:
809809
print(e)
810-
update.message.reply_text(ERROR_TEXT)
810+
update.message.reply_text(ERROR_TEXT + "\nError:\n" + str(e))
811811
return ConversationHandler.END
812812

813813

@@ -819,7 +819,7 @@ def add_income(update, context):
819819
update.message.reply_text(ADD_INCOME_TEXT)
820820
except Exception as e:
821821
print(e)
822-
update.message.reply_text(ERROR_TEXT)
822+
update.message.reply_text(ERROR_TEXT + "\nError:\n" + str(e))
823823
return ConversationHandler.END
824824
return CS.INCOME
825825

@@ -848,7 +848,7 @@ def income(update, context) -> int:
848848
return CS.WORK_PLACE
849849
except Exception as e:
850850
print(e)
851-
update.message.reply_text(ERROR_TEXT)
851+
update.message.reply_text(ERROR_TEXT + "\nError:\n" + str(e))
852852
return ConversationHandler.END
853853

854854

@@ -882,7 +882,7 @@ def cpf(update, context) -> int:
882882
return ConversationHandler.END
883883
except Exception as e:
884884
print(e)
885-
update.callback_query.message.reply_text(ERROR_TEXT)
885+
update.callback_query.message.reply_text(ERROR_TEXT + "\nError:\n" + str(e))
886886
return ConversationHandler.END
887887

888888

bot/text_str.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
+ "6. Copy your entire Google Sheet URL and send it over\n"
1515
+ "Example: https://docs.google.com/spreadsheets/d/abcd1234/edit\n"
1616
)
17-
ERROR_TEXT = "There seems to be an error, please try again later. If the problem persists, please contact report it at github.com/brucewzj99/tele-tracker-v2/issues"
17+
ERROR_TEXT = "There seems to be an error, please try again later. If the problem persists, please report it at github.com/brucewzj99/tele-tracker-v2/issues"
1818
SUCCESS_LINK_TEXT = "Google sheet successfully linked! Please proceed to configure your Dropdown sheet.\nOnce completed, type /addentry to add your first entry!"
1919
GSHEET_ERROR_TEXT = f"There seems to be an error linking your google sheet, have you shared your Google Sheet with {GOOGLE_API_EMAIL} yet?"
2020
GSHEET_WRONG_TEXT = (

release_notes.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
# Release Notes
2+
## Version 2.2.1 - Date 24 Feb 2024
3+
### Changes 🛠️
4+
- Include error message when replying back to users
5+
26
## Version 2.2.0 - Date 27 Jan 2024
37
### Bug Fix 🛠️
48
- Fix backlog bug

0 commit comments

Comments
 (0)