Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

admin_role Send gift error handle #98

Open
iach526526 opened this issue Aug 12, 2024 · 1 comment
Open

admin_role Send gift error handle #98

iach526526 opened this issue Aug 12, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@iach526526
Copy link
Member

在 admin_role,__read_db 應該要有當資料庫沒有搜尋到(ret得到空清單)按鈕 ID 時的錯誤應對,應該顯示錯誤訊息、提示有異議請開客服單並disable 按鈕

        def __read_db(self, btn_id: int):
            connection, cursor = link_sql()
            cursor.execute(f"SELECT type, count FROM `gift` WHERE `btnID`={btn_id}")
            ret = cursor.fetchall()
            cursor.execute(f"DELETE FROM `gift` WHERE `btnID`={btn_id}")
            end(connection, cursor)
            return ret[0][0], ret[0][1] # type, count

如果資料庫資料因為非預期原因遺失了,有例外處理是個比較好的做法

@iach526526 iach526526 added the invalid This doesn't seem right label Aug 12, 2024
@winstonsung winstonsung added bug Something isn't working and removed invalid This doesn't seem right labels Aug 12, 2024
@winstonsung
Copy link
Collaborator

(一般問題追蹤中invalid指的是無效的錯誤回報。)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants