เขียนข้อความแสดงข้อผิดพลาดที่นําไปใช้ได้จริง
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
หน้านี้อธิบายแนวทางปฏิบัติแนะนำในการเขียนข้อความแสดงข้อผิดพลาดที่นำไปใช้ได้จริง ซึ่งจะบอก
ผู้ใช้ถึงวิธีแก้ไขปัญหาเพื่อให้บรรลุเป้าหมาย
เมื่อผู้ใช้โต้ตอบกับแอป Google Chat การพบข้อความแสดงข้อผิดพลาดอาจเป็นประสบการณ์ที่น่าหงุดหงิดเมื่อข้อผิดพลาดนั้นไม่สามารถดำเนินการได้
เช่น ข้อความแสดงข้อผิดพลาด An error occurred
ไม่เป็นประโยชน์เนื่องจากข้อความไม่ได้อธิบายว่าเกิดอะไรขึ้น ผู้ใช้จะแก้ไขปัญหาได้อย่างไร หรือผู้ใช้จะขอรับความช่วยเหลือได้อย่างไร หน้านี้อธิบายวิธีจัดโครงสร้างข้อความแสดงข้อผิดพลาดเพื่อให้เป็นประโยชน์ต่อผู้ใช้โดยแสดงตัวอย่างที่ดำเนินการได้และดำเนินการไม่ได้
โครงสร้างข้อความแสดงข้อผิดพลาด
ข้อความแสดงข้อผิดพลาดที่ดำเนินการได้จะมีโครงสร้างดังนี้
- มีอะไรผิดพลาด การบอกเหตุผลที่แอป Chat ทำตามคำขอไม่ได้จะช่วยให้ผู้ใช้แก้ไขปัญหาได้ การอธิบายสาเหตุที่เกิดข้อผิดพลาด
จะช่วยสร้างความไว้วางใจ
- วิธีที่ผู้ใช้จะดำเนินการเพื่อให้บรรลุเป้าหมาย การบอกว่าเกิดข้อผิดพลาดอะไรขึ้นยังไม่เพียงพอ บอกให้ผู้ใช้ทราบวิธีแก้ไขข้อผิดพลาดและบรรลุเป้าหมาย
- วิธีรับความช่วยเหลือ หากผู้ใช้ยังคงติดขัดอยู่ ให้บอกวิธีรับความช่วยเหลือเพิ่มเติม ซึ่งอาจเป็นคำสั่ง
/help
หรือลิงก์ไปยังเอกสารประกอบสำหรับ
แอป Chat ของคุณ
ในตัวอย่างนี้ ผู้ใช้ป้อนวันที่ในรูปแบบที่
แอป Chat ไม่ได้คาดหวัง โดยเขียนว่า
November 19, 2021
แต่แอป Chat คาดหวัง
2021-11-19
ต่อไปนี้คือข้อความแสดงข้อผิดพลาดเวอร์ชันที่ดำเนินการได้และดำเนินการไม่ได้ซึ่งแอป Chat ตอบกลับ
ข้อผิดพลาดที่นำไปปฏิบัติได้
ผู้ใช้ขอให้แอป Chat กำหนดเวลาการประชุมกับ
บุคคลอื่น แอป Chat จะตอบกลับด้วยข้อความแสดงข้อผิดพลาดที่ชัดเจนและนำไปใช้ได้จริง ดังนี้
I don't recognize the date format you entered. Write dates as `yyyy-mm-dd`; for example, `2000-01-31`. For help, type `/help`.
ข้อความแสดงข้อผิดพลาดนี้สามารถดำเนินการได้เนื่องจากสาเหตุต่อไปนี้
- ระบุสิ่งที่ผิดพลาด แอป Chat ไม่รู้จักรูปแบบวันที่
- อธิบายวิธีแก้ไขข้อผิดพลาดโดยบอกรูปแบบวันที่ที่คาดไว้แก่ผู้ใช้
และให้ตัวอย่างวันที่ที่ช่วยให้ผู้ใช้เข้าใจสิ่งที่ต้องเขียน
- ให้ความช่วยเหลือเพิ่มเติมด้วย
/help
คำสั่งเครื่องหมายทับ หากผู้ใช้ยังคงติดขัด
ก็สามารถดูข้อมูลเพิ่มเติมได้
ข้อผิดพลาดที่ดำเนินการไม่ได้
ผู้ใช้ขอให้แอป Chat กำหนดเวลาการประชุมกับ
บุคคลอื่น แอป Chat จะตอบกลับด้วยข้อความแสดงข้อผิดพลาดที่ไม่เป็นประโยชน์และดำเนินการไม่ได้ ดังนี้
Enter the correct date format.
คุณไม่สามารถดำเนินการใดๆ กับข้อความแสดงข้อผิดพลาดนี้ได้เนื่องจากสาเหตุต่อไปนี้
- ไม่ระบุว่าได้กำหนดเวลาการประชุมหรือไม่ ผู้ใช้อาจลังเลที่จะ
กำหนดเวลาการประชุมใหม่ หรืออาจคิดว่ามีการกำหนดเวลาการประชุมแล้ว
- ไม่ได้บอกวิธีจัดรูปแบบวันที่แก่ผู้ใช้ แทนที่จะคิดว่าผู้ใช้ทราบวิธีจัดรูปแบบวันที่ ควรระบุว่าระบบคาดหวังรูปแบบวันที่
yyyy-mm-dd
- ไม่ได้ให้ความช่วยเหลือเพิ่มเติม เมื่อผู้ใช้ติดขัดและไม่ทราบวิธีดำเนินการต่อ
ผู้ใช้อาจหยุดส่งข้อความถึงแอป Chat
ลองเลย
ตอนนี้คุณทราบวิธีเขียนข้อผิดพลาดที่นำไปใช้ได้แล้ว คุณระบุได้ไหมว่าข้อผิดพลาดใดต่อไปนี้ที่นำไปใช้ได้ในสถานการณ์ต่อไปนี้
แอป Chat จะสร้างกิจกรรมในปฏิทินเมื่อผู้ใช้ส่งข้อความถึงแอป Chat โดยใช้คีย์เวิร์ด schedule
หากต้องการ
สร้างกิจกรรมในปฏิทิน แอป Chat จะกำหนดให้ผู้ใช้ต้อง
ตรวจสอบสิทธิ์ หากผู้ใช้ยังไม่ได้รับการตรวจสอบสิทธิ์ แอป Chat จะตอบกลับด้วยข้อความแสดงข้อผิดพลาด
ข้อความแสดงข้อผิดพลาดใดที่ดำเนินการได้
คุณต้องลงชื่อเข้าใช้โดยพิมพ์
/signin
ก่อนจึงจะกำหนดเวลาการประชุมได้ ดูข้อมูลเพิ่มเติมได้โดยพิมพ์ /help
ข้อความแสดงข้อผิดพลาดนี้สามารถดำเนินการได้เนื่องจากมีข้อความต่อไปนี้
- มีอะไรที่ควรปรับปรุงบ้าง แอป Chat ต้องมีการตรวจสอบสิทธิ์
- วิธีดำเนินการ พิมพ์
/signin
เพื่อตรวจสอบสิทธิ์
- วิธีรับความช่วยเหลือ หากผู้ใช้ต้องการข้อมูลเพิ่มเติม ให้พิมพ์
/help
คุณต้องตรวจสอบสิทธิ์
ข้อความแสดงข้อผิดพลาดนี้ไม่สามารถดำเนินการได้เนื่องจากไม่ได้ระบุวิธี
ตรวจสอบสิทธิ์
ลงชื่อเข้าใช้
ข้อความแสดงข้อผิดพลาดนี้ไม่สามารถดำเนินการได้เนื่องจากไม่ได้ระบุวิธีลงชื่อเข้าใช้
และบอกเป็นนัยว่าผู้ใช้ออกจากระบบแล้วแทนที่จะบอกอย่างชัดเจน
ซึ่งทำให้เกิดความสับสน
กำหนดเวลาการประชุมไม่ได้
ข้อความแสดงข้อผิดพลาดนี้ไม่สามารถดำเนินการได้เนื่องจากไม่ได้แจ้งให้ผู้ใช้ทราบ
ว่าเหตุใดจึงกำหนดเวลาการประชุมไม่ได้หรือผู้ใช้จะดำเนินการต่อได้อย่างไร ไม่มีความช่วยเหลือ
ให้
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-29 UTC
[null,null,["อัปเดตล่าสุด 2025-08-29 UTC"],[[["\u003cp\u003eGoogle Chat app error messages should be actionable, guiding users on how to resolve issues and proceed.\u003c/p\u003e\n"],["\u003cp\u003eActionable error messages clearly explain the problem, provide steps for fixing it, and offer additional help resources.\u003c/p\u003e\n"],["\u003cp\u003eInactionable error messages are vague, lack guidance, and can lead to user frustration and abandonment.\u003c/p\u003e\n"],["\u003cp\u003eUse the actionable error message structure: state the problem, guide the user on fixing it, and offer further help (e.g., \u003ccode\u003e/help\u003c/code\u003e command).\u003c/p\u003e\n"],["\u003cp\u003eWhen writing error messages, assume users need clear instructions and avoid ambiguity.\u003c/p\u003e\n"]]],["Actionable error messages in Google Chat apps should specify what went wrong, how to fix it, and how to get further assistance. For example, an actionable message for an incorrect date format would state that the format is unrecognized, specify the required format (yyyy-mm-dd), and provide a /help command. In contrast, inactionable errors are vague, omit how to correct the issue, and offer no additional support. A sign-in error should also include clear instructions, and help commands.\n"],null,["# Write actionable error messages\n\nThis page describes best practices to write actionable error messages that tell\nthe user how to fix the issue so that they can complete their goal.\n\nWhen a user is interacting with a Google Chat app, encountering\nerror messages can be a frustrating experience when the error isn't actionable.\nFor example, the error message, `An error occurred`, isn't useful because the\nmessage doesn't explain what went wrong, how the user can fix the issue, or how\nthe user can get help. This page describes how to structure error messages so\nthat they're useful to users by showing actionable and inactionable examples.\n\nError message structure\n-----------------------\n\nAn actionable error message has the following structure:\n\n- **What went wrong.** Saying why the Chat app can't complete a request helps the user resolve the issue. Explaining why an error occurred builds trust.\n- **How the user can proceed toward their goal.** It's never enough to just say what went wrong. Tell users how they can move past the error and complete their goal.\n- **How to get help.** If the user is still stuck, tell them how they can get more help. This could be a `/help` command or a link to documentation for your Chat app.\n\nExample error message: incorrect date format\n--------------------------------------------\n\nIn this example, the user entered a date in a format that\nthe Chat app didn't expect. They wrote\n`November 19, 2021`, but the Chat app expects\n`2021-11-19`.\n\nHere's an actionable and an inactionable version of the error message that the\nChat app responds with:\n\n#### Actionable error\n\nA user asks the Chat app to schedule a meeting with\nanother person. The Chat app responds with a good,\nactionable error message:\n\n``I don't recognize the date format you entered. Write dates as `yyyy-mm-dd`; for example, `2000-01-31`. For help, type `/help`.``\n\nThis error message is actionable for the following reasons:\n\n- Says what went wrong. The Chat app doesn't recognize the date format.\n- Explains how to fix the error by telling the user the expected date format and gives an example date that helps people understand what to write.\n- Offers more help with a `/help` slash command. If users are still stuck, they know how to learn more.\n\n#### Inactionable error\n\nA user asks the Chat app to schedule a meeting with\nanother person. The Chat app responds with an\nunhelpful, inactionable error message:\n\n`Enter the correct date format.`\n\nThis error message is inactionable for the following reasons:\n\n- Doesn't say whether it scheduled the meeting. The user might be hesitant to reschedule the meeting, or they might assume that the meeting was scheduled.\n- Doesn't tell the user how to format the date. Instead of assuming that users know how to format the date, it should say that it's expecting the date format `yyyy-mm-dd`.\n- Doesn't offer more help. When users are stuck and don't know how to proceed, they might stop messaging the Chat app.\n\nTry it out\n----------\n\nNow that you know how to write actionable errors, can you identify in the\nfollowing scenario which of these errors is actionable:\n\nA Chat app creates calendar events when users message\nthe Chat app with the keyword `schedule`. To\ncreate a calendar event, the Chat app requires user\nauthentication. If a user hasn't been authenticated, then the\nChat app responds with an error message. \nWhich error message is actionable? \nBefore I can schedule the meeting, you must sign in by typing `/signin`. To learn more, type `/help`. \nThis error message is actionable because it says the following:\n\n- What went wrong. The Chat app requires authentication.\n- How to proceed. Type `/signin` to authenticate.\n- How to get help. If the user wants more information, they can type `/help`. \nYou must authenticate. \nThis error message is inactionable because it doesn't say how to authenticate. \nSign in. \nThis error message is inactionable because it doesn't say how to sign in, and it implies that the user is signed out instead of clearly saying so, which is confusing. \nCan't schedule meeting. \nThis error message is inactionable because it doesn't tell the user why the meeting can't be scheduled or how the user can proceed. No help is provided."]]